Restore regular mob MASK_PET aggro scan

The scan was removed as dead code, but creature runes list Pet in
rune_enemy_monster_types, so monsters are meant to aggro summoned pets.
Restored unchanged; it stays inactive until MASK_PET is set from the
rune data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-15 09:00:27 -04:00
1 parent b60f2754f1
commit 5b80614376
1 file changed
+19
+19
View File
@@ -628,6 +628,25 @@ public class MobAI {
return;
}
}
if (aiAgent.getCombatTarget() == null) {
//look for pets to aggro if no players found to aggro
HashSet<AbstractWorldObject> awoList = WorldGrid.getObjectsInRangePartial(aiAgent, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PET);
for (AbstractWorldObject awoMob : awoList) {
// exclude self.
if (aiAgent.equals(awoMob))
continue;
Mob aggroMob = (Mob) awoMob;
aiAgent.setCombatTarget(aggroMob);
return;
}
}
} catch (Exception e) {
Logger.error(e, aiAgent.getObjectUUID() + " " + aiAgent.getName() + " Failed At: CheckForAggro");
}