Browse Source

Variable removed from city

combat-2
MagicBot 9 months ago
parent
commit
f10141eddb
  1. 7
      src/engine/net/client/handlers/DestroyBuildingHandler.java
  2. 2
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  3. 12
      src/engine/net/client/handlers/ViewResourcesMsgHandler.java
  4. 9
      src/engine/objects/City.java

7
src/engine/net/client/handlers/DestroyBuildingHandler.java

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
package engine.net.client.handlers;
import engine.mbEnums;
import engine.mbEnums.BuildingGroup;
import engine.InterestManagement.WorldGrid;
import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager;
import engine.mbEnums;
import engine.mbEnums.BuildingGroup;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.DestroyBuildingMsg;
@ -91,8 +91,9 @@ public class DestroyBuildingHandler extends AbstractClientMsgHandler { @@ -91,8 +91,9 @@ public class DestroyBuildingHandler extends AbstractClientMsgHandler {
building.disableSpire(true);
if (blueprint.getBuildingGroup() == BuildingGroup.WAREHOUSE) {
if (city != null)
city.setWarehouseBuildingID(0);
city.warehouse = null;
}
BuildingManager.setRank(building, -1);

2
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -1358,8 +1358,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -1358,8 +1358,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
if (city == null)
return true;
city.setWarehouseBuildingID(newMesh.getObjectUUID());
return true;
}
}

12
src/engine/net/client/handlers/ViewResourcesMsgHandler.java

@ -8,9 +8,8 @@ @@ -8,9 +8,8 @@
package engine.net.client.handlers;
import engine.mbEnums.DispatchChannel;
import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager;
import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
@ -46,13 +45,16 @@ public class ViewResourcesMsgHandler extends AbstractClientMsgHandler { @@ -46,13 +45,16 @@ public class ViewResourcesMsgHandler extends AbstractClientMsgHandler {
if (city == null)
return true;
Building warehouse = BuildingManager.getBuilding(city.getWarehouseBuildingID());
if (city.warehouse == null)
return true;
Building warehouseBuilding = city.warehouse.building;
if (warehouse == null)
if (warehouseBuilding == null)
return true;
ViewResourcesMsg vrm = new ViewResourcesMsg(playerCharacter);
vrm.setWarehouseBuilding(warehouse);
vrm.setWarehouseBuilding(warehouseBuilding);
vrm.setGuild(playerCharacter.getGuild());
vrm.configure();

9
src/engine/objects/City.java

@ -78,7 +78,6 @@ public class City extends AbstractWorldObject { @@ -78,7 +78,6 @@ public class City extends AbstractWorldObject {
private Vector3fImmutable location = Vector3fImmutable.ZERO;
// Players who have entered the city (used for adding and removing affects)
private Vector3fImmutable bindLoc;
private int warehouseBuildingID = 0;
private boolean open = false;
private String hash;
public Warehouse warehouse;
@ -1060,14 +1059,6 @@ public class City extends AbstractWorldObject { @@ -1060,14 +1059,6 @@ public class City extends AbstractWorldObject {
}
}
public int getWarehouseBuildingID() {
return warehouseBuildingID;
}
public void setWarehouseBuildingID(int warehouseBuildingID) {
this.warehouseBuildingID = warehouseBuildingID;
}
public final void destroy() {
Thread destroyCityThread = new Thread(new DestroyCityThread(this));

Loading…
Cancel
Save