Browse Source

Variable hidden elevated to abschar.

feature-workorder
MagicBot 1 year ago
parent
commit
71eeb3f6b8
  1. 8
      src/engine/InterestManagement/InterestManager.java
  2. 2
      src/engine/gameManager/ChatManager.java
  3. 2
      src/engine/mobileAI/MobAI.java
  4. 3
      src/engine/objects/AbstractCharacter.java
  5. 4
      src/engine/objects/Mob.java
  6. 5
      src/engine/objects/PlayerCharacter.java

8
src/engine/InterestManagement/InterestManager.java

@ -140,7 +140,7 @@ public enum InterestManager implements Runnable {
else { else {
if (pc != null) if (pc != null)
if (pcc.getSeeInvis() < pc.getHidden()) if (pcc.getSeeInvis() < pc.hidden)
continue; continue;
if (!cc.sendMsg(uom)) { if (!cc.sendMsg(uom)) {
@ -340,7 +340,7 @@ public enum InterestManager implements Runnable {
if (loadedPlayer.getObjectUUID() == player.getObjectUUID()) if (loadedPlayer.getObjectUUID() == player.getObjectUUID())
continue; continue;
if (player.getSeeInvis() < loadedPlayer.getHidden()) if (player.getSeeInvis() < loadedPlayer.hidden)
continue; continue;
if (loadedPlayer.safemodeInvis()) if (loadedPlayer.safemodeInvis())
@ -372,7 +372,7 @@ public enum InterestManager implements Runnable {
if (playerLoadedObject.getObjectType().equals(GameObjectType.PlayerCharacter)) { if (playerLoadedObject.getObjectType().equals(GameObjectType.PlayerCharacter)) {
PlayerCharacter loadedPlayer = (PlayerCharacter) playerLoadedObject; PlayerCharacter loadedPlayer = (PlayerCharacter) playerLoadedObject;
if (player.getSeeInvis() < loadedPlayer.getHidden()) if (player.getSeeInvis() < loadedPlayer.hidden)
toRemove.add(playerLoadedObject); toRemove.add(playerLoadedObject);
else if (loadedPlayer.safemodeInvis()) else if (loadedPlayer.safemodeInvis())
toRemove.add(playerLoadedObject); toRemove.add(playerLoadedObject);
@ -437,7 +437,7 @@ public enum InterestManager implements Runnable {
// dont load if invis // dont load if invis
if (player.getSeeInvis() < awopc.getHidden()) if (player.getSeeInvis() < awopc.hidden)
continue; continue;
lcm = new LoadCharacterMsg(awopc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awopc, PlayerCharacter.hideNonAscii());

2
src/engine/gameManager/ChatManager.java

@ -788,7 +788,7 @@ public enum ChatManager {
it.remove(); it.remove();
else { else {
PlayerCharacter pcc = (PlayerCharacter) awo; PlayerCharacter pcc = (PlayerCharacter) awo;
if (pcc.getSeeInvis() < pc.getHidden()) if (pcc.getSeeInvis() < pc.hidden)
it.remove(); it.remove();
} }
} }

2
src/engine/mobileAI/MobAI.java

@ -324,7 +324,7 @@ public class MobAI {
return false; return false;
} }
if (!mob.canSee((PlayerCharacter) mob.getCombatTarget())) { if (!mob.canSee((AbstractCharacter) mob.getCombatTarget())) {
mob.setCombatTarget(null); mob.setCombatTarget(null);
return false; return false;
} }

3
src/engine/objects/AbstractCharacter.java

@ -119,6 +119,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
private long takeOffTime = 0; private long takeOffTime = 0;
private long lastHateUpdate = 0; private long lastHateUpdate = 0;
private byte aoecntr = 0; private byte aoecntr = 0;
public int hidden = 0; // current rank of hide/sneak/invis
public final ConcurrentHashMap<Mob, Integer> siegeMinionMap = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); public final ConcurrentHashMap<Mob, Integer> siegeMinionMap = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
public AbstractCharacter() { public AbstractCharacter() {

4
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); return new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
} }
public boolean canSee(PlayerCharacter target) { public boolean canSee(AbstractCharacter target) {
return this.mobBase.getSeeInvis() >= target.getHidden(); return this.mobBase.getSeeInvis() >= target.hidden;
} }
public int getBuildingID() { public int getBuildingID() {

5
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 Vector3fImmutable lastStaticLoc = new Vector3fImmutable(0.0f, 0.0f, 0.0f);
private GameObjectType lastTargetType; private GameObjectType lastTargetType;
private int lastTargetID; private int lastTargetID;
private int hidden = 0; // current rank of hide/sneak/invis
private int seeInvis = 0; // current rank of see invis private int seeInvis = 0; // current rank of see invis
private float speedMod; private float speedMod;
private boolean teleportMode = false; // Teleport on MoveToPoint private boolean teleportMode = false; // Teleport on MoveToPoint
@ -2774,10 +2773,6 @@ public class PlayerCharacter extends AbstractCharacter {
this.lastStaticLoc = value; this.lastStaticLoc = value;
} }
public int getHidden() {
return this.hidden;
}
public void setHidden(int value) { public void setHidden(int value) {
this.hidden = value; this.hidden = value;
} }

Loading…
Cancel
Save