forked from MagicBane/Server
guards will revert cmbat target to null if its a player and is no longer loaded
This commit is contained in:
@@ -580,13 +580,10 @@ public class MobAI {
|
||||
|
||||
//no players loaded, no need to proceed unless it's a player guard
|
||||
boolean bypassLoadedPlayerCheck = false;
|
||||
if(mob.isPlayerGuard()) {
|
||||
|
||||
if (mob.guardedCity != null) {
|
||||
if (!mob.guardedCity._playerMemory.isEmpty()) {
|
||||
bypassLoadedPlayerCheck = true;
|
||||
}
|
||||
}
|
||||
if(mob.isPlayerGuard() || mob.isSiege()) {
|
||||
bypassLoadedPlayerCheck = true;
|
||||
if(mob.combatTarget != null && !mob.playerAgroMap.containsKey(mob.combatTarget.getObjectUUID()) && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
|
||||
mob.setCombatTarget(null);
|
||||
}
|
||||
|
||||
if (mob.playerAgroMap.isEmpty() && !bypassLoadedPlayerCheck) {
|
||||
|
||||
Reference in New Issue
Block a user