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/PassiveMonster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/PassiveMonster.cpp') diff --git a/src/Mobs/PassiveMonster.cpp b/src/Mobs/PassiveMonster.cpp index 1843ceb73..e9c4070db 100644 --- a/src/Mobs/PassiveMonster.cpp +++ b/src/Mobs/PassiveMonster.cpp @@ -57,7 +57,7 @@ void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) if (m_EMState == ESCAPING) { - CheckEventLostPlayer(); + CheckEventLostPlayer(a_Dt); } cMonster::LoveTick(); -- cgit v1.2.3