Browse Source

Null check is made before this method call.

combat-2
MagicBot 1 year ago
parent
commit
5eb6302d2a
  1. 12
      src/engine/mobileAI/MobAI.java

12
src/engine/mobileAI/MobAI.java

@ -722,16 +722,16 @@ public class MobAI { @@ -722,16 +722,16 @@ public class MobAI {
case Pet1:
if ((PlayerCharacter) mob.guardCaptain == null)
if (mob.guardCaptain == null)
return;
if (!mob.playerAgroMap.containsKey(((PlayerCharacter) mob.guardCaptain).getObjectUUID())) {
if (!mob.playerAgroMap.containsKey(mob.guardCaptain.getObjectUUID())) {
//mob no longer has its owner loaded, translocate pet to owner
MovementManager.translocate(mob, ((PlayerCharacter) mob.guardCaptain).getLoc(), null);
MovementManager.translocate(mob, mob.guardCaptain.getLoc(), null);
return;
}
if (mob.getCombatTarget() == null) {
@ -739,11 +739,11 @@ public class MobAI { @@ -739,11 +739,11 @@ public class MobAI {
//move back to owner
if (CombatUtilities.inRange2D(mob, (PlayerCharacter) mob.guardCaptain, 6))
if (CombatUtilities.inRange2D(mob, mob.guardCaptain, 6))
return;
mob.destination = ((PlayerCharacter) mob.guardCaptain).getLoc();
mob.destination = mob.guardCaptain.getLoc();
MovementUtilities.moveToLocation(mob, mob.destination, 5);
} else
chaseTarget(mob);
@ -1135,7 +1135,7 @@ public class MobAI { @@ -1135,7 +1135,7 @@ public class MobAI {
// Defer to captain if possible for current target
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) &&
mob.combatTarget == null && mob.guardCaptain.isAlive()
mob.guardCaptain.isAlive()
&& mob.guardCaptain.combatTarget != null) {
mob.setCombatTarget(mob.guardCaptain.combatTarget);
return;

Loading…
Cancel
Save