summaryrefslogtreecommitdiff
path: root/src/game/unit_nest.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/unit_nest.cpp
parent7c56f59aedddb6bb18d85e778a3acbef16b4c54f (diff)
Corpses can take damage now.
Diffstat (limited to 'src/game/unit_nest.cpp')
-rw-r--r--src/game/unit_nest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/unit_nest.cpp b/src/game/unit_nest.cpp
index a52574a..fe4a077 100644
--- a/src/game/unit_nest.cpp
+++ b/src/game/unit_nest.cpp
@@ -81,6 +81,19 @@ void unit_nest_t::on_spawn(void)
void unit_nest_t::on_damage(unit_t *attacker)
{
+ if (health < -30) {
+ assets::fx.gibbing.play_3d(x);
+ game->deletion_list.insert(this);
+ return;
+ }
+
+ if (health <= 0) {
+ if (!dead)
+ assets::fx.corpse_hit.play_3d(x);
+
+ return;
+ }
+
if (attacker)
game->hivemind_alert(x, 12.0f, true, attacker->x);
else