guards use highbred City._playerMemory.size() and Mob.playerAgroMap to go to sleep

This commit is contained in:
2023-05-18 19:54:54 -05:00
parent 0b029a5f79
commit 932daa730a
3 changed files with 10 additions and 4 deletions
+7 -3
View File
@@ -305,6 +305,13 @@ public class MobileFSM {
public static void DetermineAction(Mob mob) {
if (mob == null)
return;
if (mob.playerAgroMap.isEmpty() && !mob.isPlayerGuard)
//no players loaded, no need to proceed
return;
else{
if(mob.isPlayerGuard && mob.guardedCity._playerMemory.size() < 1 && mob.playerAgroMap.isEmpty())
return;
}
if (mob.despawned && mob.isPlayerGuard) {
//override for guards
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){
@@ -326,9 +333,6 @@ public class MobileFSM {
CheckForRespawn(mob);
return;
}
if (mob.playerAgroMap.isEmpty())
//no players loaded, no need to proceed
return;
if (mob.isCombat() && mob.getCombatTarget() == null) {
mob.setCombat(false);
UpdateStateMsg rwss = new UpdateStateMsg();