1
0

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.
This commit is contained in:
Tiger Wang
2020-12-18 20:48:32 +00:00
parent 491238f799
commit 47c0b48bfd
8 changed files with 92 additions and 63 deletions

View File

@@ -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<cPlayer *>(GetTarget())->CanMobsTarget())
{