Browse Source

Null check is made before this method call.

feature-workorder
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 {
case Pet1: case Pet1:
if ((PlayerCharacter) mob.guardCaptain == null) if (mob.guardCaptain == null)
return; 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 //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; return;
} }
if (mob.getCombatTarget() == null) { if (mob.getCombatTarget() == null) {
@ -739,11 +739,11 @@ public class MobAI {
//move back to owner //move back to owner
if (CombatUtilities.inRange2D(mob, (PlayerCharacter) mob.guardCaptain, 6)) if (CombatUtilities.inRange2D(mob, mob.guardCaptain, 6))
return; return;
mob.destination = ((PlayerCharacter) mob.guardCaptain).getLoc(); mob.destination = mob.guardCaptain.getLoc();
MovementUtilities.moveToLocation(mob, mob.destination, 5); MovementUtilities.moveToLocation(mob, mob.destination, 5);
} else } else
chaseTarget(mob); chaseTarget(mob);
@ -1135,7 +1135,7 @@ public class MobAI {
// Defer to captain if possible for current target // Defer to captain if possible for current target
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) && if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) &&
mob.combatTarget == null && mob.guardCaptain.isAlive() mob.guardCaptain.isAlive()
&& mob.guardCaptain.combatTarget != null) { && mob.guardCaptain.combatTarget != null) {
mob.setCombatTarget(mob.guardCaptain.combatTarget); mob.setCombatTarget(mob.guardCaptain.combatTarget);
return; return;

Loading…
Cancel
Save