From fade55e67e1a6944461c16c1495dea9546243756 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Thu, 19 Apr 2018 18:50:39 +0200 Subject: Improve the hivemind. --- src/game/unit_spider.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/game/unit_spider.cpp') diff --git a/src/game/unit_spider.cpp b/src/game/unit_spider.cpp index 5d6253d..7d4d0a1 100644 --- a/src/game/unit_spider.cpp +++ b/src/game/unit_spider.cpp @@ -53,7 +53,7 @@ void unit_spider_t::target_and_attack(void) // Tell everyone about a new target. if (!have_target) - hivemind_attack(this, target->x); + hivemind_attack(this, true, target->x); have_target = true; wake_time = game->time; @@ -103,14 +103,16 @@ void unit_spider_t::on_damage(unit_t *attacker) { assets::spider.sounds.play_3d(x); - if (!attacker) - return; - - hivemind_attack(this, attacker->x); + if (attacker) + hivemind_attack(this, true, attacker->x); + else + hivemind_attack(this, false, v2f_t(0, 0)); } void unit_spider_t::on_death(void) { + hivemind_attack(this, false, v2f_t(0, 0)); + if (health < -5) { assets::soldier.gib_sound.play_3d(x); game->deletion_list.insert(this); -- cgit