forked from MagicBane/Server
guards use city player memory to determine whether they go idle or not
This commit is contained in:
@@ -578,14 +578,24 @@ public class MobAI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//no players loaded, no need to proceed
|
//no players loaded, no need to proceed unless it's a player guard
|
||||||
|
boolean bypassLoadedPlayerCheck = false;
|
||||||
|
if(mob.isPlayerGuard()) {
|
||||||
|
|
||||||
if (mob.playerAgroMap.isEmpty()) {
|
if (mob.guardedCity != null) {
|
||||||
|
if (!mob.guardedCity._playerMemory.isEmpty()) {
|
||||||
|
bypassLoadedPlayerCheck = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mob.playerAgroMap.isEmpty() && !bypassLoadedPlayerCheck) {
|
||||||
if (mob.getCombatTarget() != null)
|
if (mob.getCombatTarget() != null)
|
||||||
mob.setCombatTarget(null);
|
mob.setCombatTarget(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mob.agentType.equals(Enum.AIAgentType.PET) == false)
|
if (mob.agentType.equals(Enum.AIAgentType.PET) == false)
|
||||||
CheckToSendMobHome(mob);
|
CheckToSendMobHome(mob);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user