From 39638e4789dd582830bf715ffe3fe9047a5234b4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 8 Jan 2025 18:08:38 -0600 Subject: [PATCH] mob ai work --- src/engine/mobileAI/MobAI.java | 32 +++++++++++++++++--------------- src/engine/mobileAI/MobAi2.java | 5 +---- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index e0c2621d..22beeece 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -560,21 +560,6 @@ public class MobAI { public static void MobCallForHelp(Mob mob) { - boolean continueExecution = false; - switch(mob.BehaviourType){ - case GuardCaptain: - case GuardMinion: - case Pet1: - case GuardWallArcher: - case HamletGuard: - case SimpleStandingGuard: - continueExecution = true; - break; - } - if(!continueExecution) { - MobAi2.runAI(mob); - return; - } try { boolean callGotResponse = false; @@ -616,6 +601,23 @@ public class MobAI { if (mob == null) return; + + boolean continueExecution = false; + switch(mob.BehaviourType){ + case GuardCaptain: + case GuardMinion: + case Pet1: + case GuardWallArcher: + case HamletGuard: + case SimpleStandingGuard: + continueExecution = true; + break; + } + if(!continueExecution) { + MobAi2.runAI(mob); + return; + } + if(mob.isAlive()) if(!mob.getMovementLoc().equals(Vector3fImmutable.ZERO)) mob.setLoc(mob.getMovementLoc()); diff --git a/src/engine/mobileAI/MobAi2.java b/src/engine/mobileAI/MobAi2.java index fbab0711..857be797 100644 --- a/src/engine/mobileAI/MobAi2.java +++ b/src/engine/mobileAI/MobAi2.java @@ -64,7 +64,7 @@ public class MobAi2 { switch(getState(mob)){ case Idle: if(mob.isMoving()) - mob.stopMovement(mob.getMovementLoc()); + mob.stopMovement(mob.loc); if(mob.combatTarget != null) { mob.setCombatTarget(null); mob.setCombat(false); @@ -128,7 +128,6 @@ public class MobAi2 { if (mob.canSee(target)) mob.setCombatTarget(target); if (mob.combatTarget != null) { - mob.stopMovement(mob.getMovementLoc()); return; } } @@ -166,8 +165,6 @@ public class MobAi2 { MovementUtilities.aiMove(mob, target.loc, false); } return; - }else{ - mob.stopMovement(mob.getMovementLoc()); } switch (target.getObjectType()) {