diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-04-21 14:43:40 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-04-21 14:43:40 +0200 |
commit | 8d740f470fb5ed5f63a3d59d3867189626e285b9 (patch) | |
tree | 30123091126a86c82f081de10f3ec7e0f92a0a6c /src/game/unit_spider.cpp | |
parent | 7c56f59aedddb6bb18d85e778a3acbef16b4c54f (diff) |
Corpses can take damage now.
Diffstat (limited to 'src/game/unit_spider.cpp')
-rw-r--r-- | src/game/unit_spider.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
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); |