Browse Source

Duplicate building and building ID values.

combat-2
MagicBot 1 year ago
parent
commit
adafbdf6d3
  1. 11
      src/engine/objects/Mob.java
  2. 9
      src/engine/objects/PlayerCharacter.java

11
src/engine/objects/Mob.java

@ -63,7 +63,6 @@ public class Mob extends AbstractIntelligenceAgent {
public MobBase mobBase; public MobBase mobBase;
public int spawnTime; public int spawnTime;
public Zone parentZone; public Zone parentZone;
public Building building;
public boolean hasLoot = false; public boolean hasLoot = false;
public boolean isPlayerGuard = false; public boolean isPlayerGuard = false;
public AbstractCharacter npcOwner; public AbstractCharacter npcOwner;
@ -89,7 +88,7 @@ public class Mob extends AbstractIntelligenceAgent {
private int currentID; private int currentID;
private int ownerUID = 0; //only used by pets private int ownerUID = 0; //only used by pets
private AbstractWorldObject fearedObject = null; private AbstractWorldObject fearedObject = null;
private int buildingID;
public boolean isSiege = false; public boolean isSiege = false;
private long lastAttackTime = 0; private long lastAttackTime = 0;
private int lastMobPowerToken = 0; private int lastMobPowerToken = 0;
@ -120,9 +119,9 @@ public class Mob extends AbstractIntelligenceAgent {
this.building = building; this.building = building;
if (building != null) if (building != null)
this.buildingID = building.getObjectUUID(); this.buildingUUID = building.getObjectUUID();
else else
this.buildingID = 0; this.buildingUUID = 0;
if (contractID == 0) if (contractID == 0)
this.contract = null; this.contract = null;
@ -2000,11 +1999,11 @@ public class Mob extends AbstractIntelligenceAgent {
} }
public int getBuildingID() { public int getBuildingID() {
return buildingID; return buildingUUID;
} }
public void setBuildingID(int buildingID) { public void setBuildingID(int buildingID) {
this.buildingID = buildingID; this.buildingUUID = buildingID;
} }
public boolean isSiege() { public boolean isSiege() {

9
src/engine/objects/PlayerCharacter.java

@ -144,7 +144,6 @@ public class PlayerCharacter extends AbstractCharacter {
private long lastUpdateTime = System.currentTimeMillis(); private long lastUpdateTime = System.currentTimeMillis();
private long lastStamUpdateTime = System.currentTimeMillis(); private long lastStamUpdateTime = System.currentTimeMillis();
private boolean safeZone = false; private boolean safeZone = false;
private int bindBuildingID;
/* /*
DataWarehouse based kill/death tracking. DataWarehouse based kill/death tracking.
@ -205,7 +204,7 @@ public class PlayerCharacter extends AbstractCharacter {
this.spiMod.set(spiMod); this.spiMod.set(spiMod);
this.guildStatus = new AtomicInteger(0); this.guildStatus = new AtomicInteger(0);
this.bindBuildingID = -1; this.buildingUUID = -1;
} }
/** /**
@ -265,7 +264,7 @@ public class PlayerCharacter extends AbstractCharacter {
this.intMod.set(rs.getShort("char_intMod")); this.intMod.set(rs.getShort("char_intMod"));
this.spiMod.set(rs.getShort("char_spiMod")); this.spiMod.set(rs.getShort("char_spiMod"));
this.bindBuildingID = rs.getInt("char_bindBuilding"); this.buildingUUID = rs.getInt("char_bindBuilding");
this.hash = rs.getString("hash"); this.hash = rs.getString("hash");
@ -2721,12 +2720,12 @@ public class PlayerCharacter extends AbstractCharacter {
*/ */
public synchronized int getBindBuildingID() { public synchronized int getBindBuildingID() {
return this.bindBuildingID; return this.buildingUUID;
} }
public synchronized void setBindBuildingID(int value) { public synchronized void setBindBuildingID(int value) {
DbManager.PlayerCharacterQueries.SET_BIND_BUILDING(this, value); DbManager.PlayerCharacterQueries.SET_BIND_BUILDING(this, value);
this.bindBuildingID = value; this.buildingUUID = value;
} }
public AbstractGameObject getLastTarget() { public AbstractGameObject getLastTarget() {

Loading…
Cancel
Save