Browse Source

mobs dont chase invisible players

lakebane-dex-penalty
FatBoy-DOTC 1 week ago
parent
commit
6c6a64fa98
  1. 3
      src/engine/devcmd/cmds/InfoCmd.java
  2. 5
      src/engine/mobileAI/MobAI.java

3
src/engine/devcmd/cmds/InfoCmd.java

@ -342,7 +342,8 @@ public class InfoCmd extends AbstractDevCmd {
output += newline; output += newline;
output += "isMoving : " + targetPC.isMoving(); output += "isMoving : " + targetPC.isMoving();
output += newline; output += newline;
output += "Zerg Multiplier : " + targetPC.ZergMultiplier; output += "Zerg Multiplier : " + targetPC.ZergMultiplier+ newline;
output += "Hidden : " + targetPC.getHidden();
break; break;
case NPC: case NPC:

5
src/engine/mobileAI/MobAI.java

@ -994,6 +994,11 @@ public class MobAI {
try { try {
if(mob.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && !mob.canSee((PlayerCharacter)mob.combatTarget)){
mob.setCombatTarget(null);
return;
}
float rangeSquared = mob.getRange() * mob.getRange(); float rangeSquared = mob.getRange() * mob.getRange();
float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc()); float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc());

Loading…
Cancel
Save