mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 10:58:20 +00:00
[Crash] Pointer validation in mob iteration loops (#2490)
This commit is contained in:
@@ -3463,6 +3463,9 @@ bool NPC::AICheckCloseBeneficialSpells(
|
||||
*/
|
||||
for (auto & close_mob : entity_list.GetCloseMobList(caster, cast_range)) {
|
||||
Mob *mob = close_mob.second;
|
||||
if (!mob) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mob->IsClient()) {
|
||||
continue;
|
||||
@@ -3539,6 +3542,10 @@ void NPC::AIYellForHelp(Mob *sender, Mob *attacker)
|
||||
|
||||
for (auto &close_mob : entity_list.GetCloseMobList(sender)) {
|
||||
Mob *mob = close_mob.second;
|
||||
if (!mob) {
|
||||
continue;
|
||||
}
|
||||
|
||||
float distance = DistanceSquared(m_Position, mob->GetPosition());
|
||||
|
||||
if (mob->IsClient()) {
|
||||
|
||||
Reference in New Issue
Block a user