From 47c0b48bfd5df90cf889574c5634542d2aaa8873 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 18 Dec 2020 20:48:32 +0000 Subject: Monsters: improve targeting * Replace DoWithNearestPlayer with bounding box search (avoid iterating through all players in world). * Do line-of-sight checks from eye-to-eye. + Added LOS and LOS lost timer to target lost checks, in addition to distance. --- src/Mobs/PassiveAggressiveMonster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/PassiveAggressiveMonster.cpp') diff --git a/src/Mobs/PassiveAggressiveMonster.cpp b/src/Mobs/PassiveAggressiveMonster.cpp index bf4a3167c..d96b87566 100644 --- a/src/Mobs/PassiveAggressiveMonster.cpp +++ b/src/Mobs/PassiveAggressiveMonster.cpp @@ -26,7 +26,7 @@ bool cPassiveAggressiveMonster::DoTakeDamage(TakeDamageInfo & a_TDI) return false; } - if ((GetTarget() != nullptr) && (GetTarget()->IsPlayer())) + if ((GetTarget() != nullptr) && GetTarget()->IsPlayer()) { if (static_cast(GetTarget())->CanMobsTarget()) { -- cgit v1.2.3