From 8d740f470fb5ed5f63a3d59d3867189626e285b9 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Apr 2018 14:43:40 +0200 Subject: Corpses can take damage now. --- src/game/unit_spider.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/game/unit_spider.cpp') diff --git a/src/game/unit_spider.cpp b/src/game/unit_spider.cpp index 2838a8b..c6f5755 100644 --- a/src/game/unit_spider.cpp +++ b/src/game/unit_spider.cpp @@ -101,6 +101,19 @@ void unit_spider_t::on_think(void) void unit_spider_t::on_damage(unit_t *attacker) { + if (health < -5) { + 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; + } + assets::spider.sounds.play_3d(x); if (attacker) @@ -113,12 +126,6 @@ void unit_spider_t::on_death(void) { game->hivemind_alert(x, 16.0f, false, v2f_t(0, 0)); - if (health < -5) { - assets::soldier.gib_sound.play_3d(x); - game->deletion_list.insert(this); - return; - } - render_layer = render::LAYER_FLAT; cmodel.cflags = CF_BACKGROUND; assets::spider.sounds.play_3d(x); -- cgit