From 055b3d3d661d43b03601b4a0ba6c0037fc714bf2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 25 Jul 2023 21:27:54 -0500 Subject: [PATCH] update location --- src/engine/ai/MobileFSM.java | 13 ++++--------- src/engine/objects/Mob.java | 2 ++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index 3069006d..8476a05c 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -43,6 +43,7 @@ public class MobileFSM { } if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) { if (MobCast(mob)) { + mob.updateLocation(); return; } } @@ -62,6 +63,7 @@ public class MobileFSM { AttackMob(mob, targetMob); break; } + mob.updateLocation(); } public static void AttackPlayer(Mob mob, PlayerCharacter target) { @@ -384,15 +386,6 @@ public class MobileFSM { if (mob.combatTarget != null && mob.combatTarget.isAlive() == false) { mob.setCombatTarget(null); } - //mob.updateLocation(); - //if(mob.getTimestamps().containsKey("MOVEMENTSYNC") == false){ - // mob.getTimestamps().put("MOVEMENTSYNC",System.currentTimeMillis()); - //} - //if(mob.getTimeStamp("MOVEMENTSYNC") < System.currentTimeMillis() + 1000){ - // mob.getTimestamps().put("MOVEMENTSYNC",System.currentTimeMillis()); - - // mob.setLoc(mob.getMovementLoc()); - //} switch (mob.BehaviourType) { case GuardCaptain: GuardCaptainLogic(mob); @@ -461,6 +454,7 @@ public class MobileFSM { private static void CheckMobMovement(Mob mob) { if (!MovementUtilities.canMove(mob)) return; + mob.updateLocation(); switch (mob.BehaviourType) { case Pet1: if(mob.getOwner() == null){ @@ -604,6 +598,7 @@ public class MobileFSM { private static void chaseTarget(Mob mob) { mob.updateMovementState(); + mob.updateLocation(); if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { if (mob.getRange() > 15) { mob.destination = mob.getCombatTarget().getLoc(); diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index cad73bcb..8bc7d125 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1377,6 +1377,7 @@ public class Mob extends AbstractIntelligenceAgent { } catch (Exception e) { Logger.error(e); } + this.updateLocation(); } public void respawn() { @@ -1406,6 +1407,7 @@ public class Mob extends AbstractIntelligenceAgent { //MovementManager.translocate(this, this.bindLoc, this.region); if (!this.isSiege && !this.isPlayerGuard && contract == null) loadInventory(); + this.updateLocation(); } public void despawn() {