Browse Source

should never pull directly form cache

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
7ce94a5166
  1. 6
      src/engine/mobileAI/MobAI.java
  2. 5
      src/engine/objects/Building.java
  3. 7
      src/engine/objects/City.java

6
src/engine/mobileAI/MobAI.java

@ -657,7 +657,7 @@ public class MobAI {
for (Entry playerEntry : loadedPlayers.entrySet()) { for (Entry playerEntry : loadedPlayers.entrySet()) {
int playerID = (int) playerEntry.getKey(); int playerID = (int) playerEntry.getKey();
PlayerCharacter loadedPlayer = PlayerCharacter.getFromCache(playerID); PlayerCharacter loadedPlayer = PlayerCharacter.getPlayerCharacter(playerID);
//Player is null, let's remove them from the list. //Player is null, let's remove them from the list.
@ -1105,7 +1105,7 @@ public class MobAI {
for (Entry playerEntry : loadedPlayers.entrySet()) { for (Entry playerEntry : loadedPlayers.entrySet()) {
int playerID = (int) playerEntry.getKey(); int playerID = (int) playerEntry.getKey();
PlayerCharacter loadedPlayer = PlayerCharacter.getFromCache(playerID); PlayerCharacter loadedPlayer = PlayerCharacter.getPlayerCharacter(playerID);
//Player is null, let's remove them from the list. //Player is null, let's remove them from the list.
@ -1280,7 +1280,7 @@ public class MobAI {
for (Entry playerEntry : mob.playerAgroMap.entrySet()) { for (Entry playerEntry : mob.playerAgroMap.entrySet()) {
PlayerCharacter potentialTarget = PlayerCharacter.getFromCache((int) playerEntry.getKey()); PlayerCharacter potentialTarget = PlayerCharacter.getPlayerCharacter((int) playerEntry.getKey());
if (potentialTarget.equals(mob.getCombatTarget())) if (potentialTarget.equals(mob.getCombatTarget()))
continue; continue;

5
src/engine/objects/Building.java

@ -807,10 +807,11 @@ public class Building extends AbstractWorldObject {
if (this.ownerUUID == 0) if (this.ownerUUID == 0)
return null; return null;
if (this.ownerIsNPC) if (this.ownerIsNPC)
return NPC.getFromCache(this.ownerUUID); return NPC.getNPC(this.ownerUUID);
return PlayerCharacter.getFromCache(this.ownerUUID); return PlayerCharacter.getPlayerCharacter(this.ownerUUID);
} }

7
src/engine/objects/City.java

@ -868,7 +868,6 @@ public class City extends AbstractWorldObject {
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this); player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
} }
} }
public Warehouse getWarehouse() { public Warehouse getWarehouse() {
@ -894,12 +893,6 @@ public class City extends AbstractWorldObject {
return collided; return collided;
} }
public boolean isLocationOnCityGrid(Bounds newBounds) {
boolean collided = Bounds.collide(this.getBounds(), newBounds, 0);
return collided;
}
public boolean isLocationWithinSiegeBounds(Vector3fImmutable insideLoc) { public boolean isLocationWithinSiegeBounds(Vector3fImmutable insideLoc) {
return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.ZONE.halfExtents); return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.ZONE.halfExtents);

Loading…
Cancel
Save