summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/units.cpp21
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)