mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Hotfix] Check if the mob is already in the close mobs list before inserting
This commit is contained in:
parent
3f0f95976c
commit
011e1d05e7
@ -2972,7 +2972,10 @@ void EntityList::ScanCloseMobs(Mob *scanning_mob)
|
||||
float distance = DistanceSquared(scanning_mob->GetPosition(), mob->GetPosition());
|
||||
if (distance <= scan_range || mob->GetAggroRange() >= scan_range) {
|
||||
// add mob to scanning_mob's close list and vice versa
|
||||
// check if the mob is already in the close mobs list before inserting
|
||||
if (mob->m_close_mobs.find(scanning_mob->GetID()) == mob->m_close_mobs.end()) {
|
||||
mob->m_close_mobs[scanning_mob->GetID()] = scanning_mob;
|
||||
}
|
||||
scanning_mob->m_close_mobs[mob->GetID()] = mob;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user