Remove siege and pet auto-aggro scans

Guard MASK_SIEGE and regular mob MASK_PET scans were dead code: no mob
ever carries either mask. Removed so they cannot start auto-aggroing
siege engines if the masks are wired up later. Safehold guards no
longer aggro siege engines. Guards still respond to a siege engine
damaging a city building.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-15 08:53:57 -04:00
1 parent 89cdf5655d
commit b60f2754f1
1 file changed
+5 -34
+5 -34
View File
@@ -628,25 +628,6 @@ 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");
}
@@ -876,6 +857,10 @@ public class MobAI {
if (aggroMob.agentType.equals(mbEnums.AIAgentType.PET))
continue;
//don't attack siege engines
if (aggroMob.isSiege())
continue;
if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50))
continue;
@@ -1098,23 +1083,9 @@ public class MobAI {
return;
}
}
if (mob.getCombatTarget() == null) {
//look for siege equipment to aggro if no players found to aggro
// guards never auto-aggro siege engines; they only respond when one damages a city building
HashSet<AbstractWorldObject> awoList = WorldGrid.getObjectsInRangePartial(mob, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_SIEGE);
for (AbstractWorldObject awoMob : awoList) {
Mob aggroMob = (Mob) awoMob;
if (guardCanAggro(mob, aggroMob)) {
mob.setCombatTarget(aggroMob);
return;
}
}
}
} catch (Exception e) {
Logger.error(e, mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckForPlayerGuardAggro");
}