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

9
src/engine/objects/PlayerCharacter.java

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

Loading…
Cancel
Save