From 71eeb3f6b8ba8f79493af5402c78d9b33b56492d Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 2 Sep 2023 15:57:23 -0400 Subject: [PATCH] Variable hidden elevated to abschar. --- src/engine/InterestManagement/InterestManager.java | 8 ++++---- src/engine/gameManager/ChatManager.java | 2 +- src/engine/mobileAI/MobAI.java | 2 +- src/engine/objects/AbstractCharacter.java | 3 +++ src/engine/objects/Mob.java | 4 ++-- src/engine/objects/PlayerCharacter.java | 5 ----- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/engine/InterestManagement/InterestManager.java b/src/engine/InterestManagement/InterestManager.java index 2c70765c..a9cf4c50 100644 --- a/src/engine/InterestManagement/InterestManager.java +++ b/src/engine/InterestManagement/InterestManager.java @@ -140,7 +140,7 @@ public enum InterestManager implements Runnable { else { if (pc != null) - if (pcc.getSeeInvis() < pc.getHidden()) + if (pcc.getSeeInvis() < pc.hidden) continue; if (!cc.sendMsg(uom)) { @@ -340,7 +340,7 @@ public enum InterestManager implements Runnable { if (loadedPlayer.getObjectUUID() == player.getObjectUUID()) continue; - if (player.getSeeInvis() < loadedPlayer.getHidden()) + if (player.getSeeInvis() < loadedPlayer.hidden) continue; if (loadedPlayer.safemodeInvis()) @@ -372,7 +372,7 @@ public enum InterestManager implements Runnable { if (playerLoadedObject.getObjectType().equals(GameObjectType.PlayerCharacter)) { PlayerCharacter loadedPlayer = (PlayerCharacter) playerLoadedObject; - if (player.getSeeInvis() < loadedPlayer.getHidden()) + if (player.getSeeInvis() < loadedPlayer.hidden) toRemove.add(playerLoadedObject); else if (loadedPlayer.safemodeInvis()) toRemove.add(playerLoadedObject); @@ -437,7 +437,7 @@ public enum InterestManager implements Runnable { // dont load if invis - if (player.getSeeInvis() < awopc.getHidden()) + if (player.getSeeInvis() < awopc.hidden) continue; lcm = new LoadCharacterMsg(awopc, PlayerCharacter.hideNonAscii()); diff --git a/src/engine/gameManager/ChatManager.java b/src/engine/gameManager/ChatManager.java index 496cfb6c..70d49f39 100644 --- a/src/engine/gameManager/ChatManager.java +++ b/src/engine/gameManager/ChatManager.java @@ -788,7 +788,7 @@ public enum ChatManager { it.remove(); else { PlayerCharacter pcc = (PlayerCharacter) awo; - if (pcc.getSeeInvis() < pc.getHidden()) + if (pcc.getSeeInvis() < pc.hidden) it.remove(); } } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index db27d7ba..b32b43bf 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -324,7 +324,7 @@ public class MobAI { return false; } - if (!mob.canSee((PlayerCharacter) mob.getCombatTarget())) { + if (!mob.canSee((AbstractCharacter) mob.getCombatTarget())) { mob.setCombatTarget(null); return false; } diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 84c5b784..145a56e6 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -119,6 +119,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject { private long takeOffTime = 0; private long lastHateUpdate = 0; private byte aoecntr = 0; + + public int hidden = 0; // current rank of hide/sneak/invis + public final ConcurrentHashMap siegeMinionMap = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); public AbstractCharacter() { diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 3c761cb5..ca022e28 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1679,8 +1679,8 @@ public class Mob extends AbstractIntelligenceAgent { return new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); } - public boolean canSee(PlayerCharacter target) { - return this.mobBase.getSeeInvis() >= target.getHidden(); + public boolean canSee(AbstractCharacter target) { + return this.mobBase.getSeeInvis() >= target.hidden; } public int getBuildingID() { diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 92cdf909..15a62756 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -135,7 +135,6 @@ public class PlayerCharacter extends AbstractCharacter { private Vector3fImmutable lastStaticLoc = new Vector3fImmutable(0.0f, 0.0f, 0.0f); private GameObjectType lastTargetType; private int lastTargetID; - private int hidden = 0; // current rank of hide/sneak/invis private int seeInvis = 0; // current rank of see invis private float speedMod; private boolean teleportMode = false; // Teleport on MoveToPoint @@ -2774,10 +2773,6 @@ public class PlayerCharacter extends AbstractCharacter { this.lastStaticLoc = value; } - public int getHidden() { - return this.hidden; - } - public void setHidden(int value) { this.hidden = value; }