summaryrefslogtreecommitdiff
path: root/src/game/units.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-04-21 14:43:40 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-04-21 14:43:40 +0200
commit8d740f470fb5ed5f63a3d59d3867189626e285b9 (patch)
tree30123091126a86c82f081de10f3ec7e0f92a0a6c /src/game/units.cpp
parent7c56f59aedddb6bb18d85e778a3acbef16b4c54f (diff)
Corpses can take damage now.
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r--src/game/units.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp
index f1ee45e..c4bc8de 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -191,12 +191,9 @@ void unit_t::damage(int points, unit_t *attacker)
bool alien;
health -= points;
- if (health <= 0)
+ on_damage(attacker);
+ if (health <= 0 && !dead)
die(attacker);
- else {
- wake();
- on_damage(attacker);
- }
switch (type) {
case UNIT_SOLDIER: