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:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user