From cfffdb2104364032edfcfa57b47e0664dc7f0c35 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Fri, 20 Apr 2018 18:12:24 +0200 Subject: Fix wrongly colored blood splashes. --- src/game/units.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/game') 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) -- cgit