Browse Source

Mob Casting bypasses mele range check

master
FatBoy-DOTC 1 year ago
parent
commit
da51be1bef
  1. 10
      src/engine/ai/MobileFSM.java

10
src/engine/ai/MobileFSM.java

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

Loading…
Cancel
Save