pet run/walk determined by owner

This commit is contained in:
2024-05-21 14:16:03 -05:00
parent b6a9a0c813
commit 5e84ee8b11
+11 -3
View File
@@ -428,9 +428,10 @@ public class MobAI {
mob.updateLocation(); mob.updateLocation();
} }
if(!mob.isPet()) {
boolean combatState = mob.isCombat(); boolean combatState = mob.isCombat();
mob.setCombat(mob.combatTarget != null); mob.setCombat(mob.combatTarget != null);
if(combatState != mob.isCombat()){ if (combatState != mob.isCombat()) {
//send message to update combat state //send message to update combat state
UpdateStateMsg rwss = new UpdateStateMsg(); UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(mob); rwss.setPlayer(mob);
@@ -439,11 +440,18 @@ public class MobAI {
boolean walking = mob.isWalk(); boolean walking = mob.isWalk();
mob.setWalkMode(mob.combatTarget == null); mob.setWalkMode(mob.combatTarget == null);
if(walking != mob.isWalk()){ if (walking != mob.isWalk()) {
//send message to update run/walk state //send message to update run/walk state
MovementManager.sendRWSSMsg(mob); MovementManager.sendRWSSMsg(mob);
} }
}else {
boolean walking = mob.isWalk();
mob.setWalkMode(mob.guardCaptain.isWalk());
if (walking != mob.isWalk()) {
//send message to update run/walk state
MovementManager.sendRWSSMsg(mob);
}
}
switch (mob.behaviourType) { switch (mob.behaviourType) {
case GuardCaptain: case GuardCaptain:
GuardCaptainLogic(mob); GuardCaptainLogic(mob);