diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-04-20 18:12:24 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-04-20 18:12:24 +0200 |
commit | cfffdb2104364032edfcfa57b47e0664dc7f0c35 (patch) | |
tree | 855ce9a14359ba7c17342043b4ef8350f9927a13 /src/game | |
parent | c916f71c619017b88b9f792d7e002fb01588e4d5 (diff) |
Fix wrongly colored blood splashes.
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/units.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp index 3ded53c..5ee626b 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -186,9 +186,7 @@ void unit_t::stop_moving(void) void unit_t::damage(int points, unit_t *attacker) { fx_blood_t *blood; - - blood = new fx_blood_t(game, x, type == UNIT_SPIDER); - blood->place(&game->world); + bool alien; health -= points; if (health <= 0) @@ -197,6 +195,23 @@ void unit_t::damage(int points, unit_t *attacker) wake(); on_damage(attacker); } + + switch (type) { + case UNIT_SOLDIER: + alien = false; + break; + + case UNIT_SPIDER: + case UNIT_NEST: + alien = true; + break; + + default: + return; + } + + blood = new fx_blood_t(game, x, alien); + blood->place(&game->world); } void unit_t::die(unit_t *killer) |