Browse Source

removed distance check preventing pets from attacking

master
FatBoy-DOTC 1 year ago
parent
commit
48bcf1bd1f
  1. 12
      src/engine/ai/MobileFSM.java

12
src/engine/ai/MobileFSM.java

@ -604,10 +604,10 @@ public class MobileFSM {
private static void chaseTarget(Mob mob) { private static void chaseTarget(Mob mob) {
mob.updateMovementState(); mob.updateMovementState();
//if (mob.playerAgroMap.containsKey(mob.getCombatTarget().getObjectUUID()) == false) { if (mob.playerAgroMap.containsKey(mob.getCombatTarget().getObjectUUID()) == false) {
// mob.setCombatTarget(null); mob.setCombatTarget(null);
// return; return;
//} }
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) {
if (mob.getRange() > 15) { if (mob.getRange() > 15) {
mob.destination = mob.getCombatTarget().getLoc(); mob.destination = mob.getCombatTarget().getLoc();
@ -679,8 +679,8 @@ public class MobileFSM {
} }
} }
if (mob.getCombatTarget() != null) if (mob.getCombatTarget() != null)
if(!mob.getCombatTarget().isAlive() || mob.getCombatTarget().getLoc().distanceSquared(mob.getOwner().getLoc()) > 75) //if(!mob.getCombatTarget().isAlive() || mob.getCombatTarget().getLoc().distanceSquared(mob.getOwner().getLoc()) > 75)
mob.setCombatTarget(null); //mob.setCombatTarget(null);
if (MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam) if (MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam)
CheckMobMovement(mob); CheckMobMovement(mob);
CheckForAttack(mob); CheckForAttack(mob);

Loading…
Cancel
Save