Browse Source

Variable hidden elevated to abschar.

combat-2
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 { @@ -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 { @@ -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 { @@ -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 { @@ -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());

2
src/engine/gameManager/ChatManager.java

@ -788,7 +788,7 @@ public enum ChatManager { @@ -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();
}
}

2
src/engine/mobileAI/MobAI.java

@ -324,7 +324,7 @@ public class MobAI { @@ -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;
}

3
src/engine/objects/AbstractCharacter.java

@ -119,6 +119,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -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<Mob, Integer> siegeMinionMap = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
public AbstractCharacter() {

4
src/engine/objects/Mob.java

@ -1679,8 +1679,8 @@ public class Mob extends AbstractIntelligenceAgent { @@ -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() {

5
src/engine/objects/PlayerCharacter.java

@ -135,7 +135,6 @@ public class PlayerCharacter extends AbstractCharacter { @@ -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 { @@ -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;
}

Loading…
Cancel
Save