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:
1 parent
89cdf5655d
commit
b60f2754f1
1 file changed
+5
-34
@@ -628,25 +628,6 @@ public class MobAI {
|
|||||||
return;
|
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) {
|
} catch (Exception e) {
|
||||||
Logger.error(e, aiAgent.getObjectUUID() + " " + aiAgent.getName() + " Failed At: CheckForAggro");
|
Logger.error(e, aiAgent.getObjectUUID() + " " + aiAgent.getName() + " Failed At: CheckForAggro");
|
||||||
}
|
}
|
||||||
@@ -876,6 +857,10 @@ public class MobAI {
|
|||||||
if (aggroMob.agentType.equals(mbEnums.AIAgentType.PET))
|
if (aggroMob.agentType.equals(mbEnums.AIAgentType.PET))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
//don't attack siege engines
|
||||||
|
if (aggroMob.isSiege())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50))
|
if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1098,23 +1083,9 @@ public class MobAI {
|
|||||||
return;
|
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) {
|
} catch (Exception e) {
|
||||||
Logger.error(e, mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckForPlayerGuardAggro");
|
Logger.error(e, mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckForPlayerGuardAggro");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user