Browse Source

Mob Casting bypasses mele range check

master
FatBoy-DOTC 2 years ago
parent
commit
da51be1bef
  1. 12
      src/engine/ai/MobileFSM.java

12
src/engine/ai/MobileFSM.java

@ -36,17 +36,17 @@ public class MobileFSM { @@ -36,17 +36,17 @@ public class MobileFSM {
mob.setCombatTarget(null);
return;
}
if(target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)){
if(MobCast(mob)){
return;
}
}
if (!CombatUtilities.inRangeToAttack(mob, target))
return;
switch (target.getObjectType()) {
case PlayerCharacter:
PlayerCharacter targetPlayer = (PlayerCharacter) target;
if (canCast(mob)) {
if (!MobCast(mob))
AttackPlayer(mob, targetPlayer);
} else {
AttackPlayer(mob, targetPlayer);
}
AttackPlayer(mob, targetPlayer);
break;
case Building:
Building targetBuilding = (Building) target;

Loading…
Cancel
Save