Browse Source

See Invis Bug Addressed

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
c304a59d95
  1. 16
      src/engine/mobileAI/MobAI.java
  2. 4
      src/engine/objects/PlayerCharacter.java

16
src/engine/mobileAI/MobAI.java

@ -48,7 +48,12 @@ public class MobAI { @@ -48,7 +48,12 @@ public class MobAI {
mob.setCombatTarget(null);
return;
}
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter){
if(((PlayerCharacter)target).getHidden() > 0){
mob.setCombatTarget(null);
return;
}
}
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) {
if (mob.isPlayerGuard() == false && MobCast(mob)) {
@ -736,7 +741,7 @@ public class MobAI { @@ -736,7 +741,7 @@ public class MobAI {
//Player is Dead, Mob no longer needs to attempt to aggro. Remove them from aggro map.
if (!loadedPlayer.isAlive()) {
if (!loadedPlayer.isAlive() || loadedPlayer.getHidden() > 0) {
loadedPlayers.remove(playerID);
continue;
}
@ -978,7 +983,12 @@ public class MobAI { @@ -978,7 +983,12 @@ public class MobAI {
private static void chaseTarget(Mob mob) {
try {
if (mob.combatTarget.getObjectType() == Enum.GameObjectType.PlayerCharacter){
if(((PlayerCharacter)mob.combatTarget).getHidden() > 0){
mob.setCombatTarget(null);
return;
}
}
float rangeSquared = mob.getRange() * mob.getRange();
float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc());

4
src/engine/objects/PlayerCharacter.java

@ -3324,7 +3324,9 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3324,7 +3324,9 @@ public class PlayerCharacter extends AbstractCharacter {
if (this.equals(tar))
return true;
if(this.getSeeInvis() >= 20){
return !tar.safemodeInvis();
}
return this.getSeeInvis() >= tar.hidden && !tar.safemodeInvis();
}

Loading…
Cancel
Save