From b2f3e7a63575e2141394fb5f8237442596b96b46 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 17 Mar 2024 11:36:26 -0400 Subject: [PATCH] Building set on load --- src/engine/net/client/handlers/TaxCityMsgHandler.java | 2 +- src/engine/net/client/msg/ArcViewAssetTransactionsMsg.java | 6 +++--- src/engine/objects/City.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/net/client/handlers/TaxCityMsgHandler.java b/src/engine/net/client/handlers/TaxCityMsgHandler.java index 511d7fb5..de320b1d 100644 --- a/src/engine/net/client/handlers/TaxCityMsgHandler.java +++ b/src/engine/net/client/handlers/TaxCityMsgHandler.java @@ -111,7 +111,7 @@ public class TaxCityMsgHandler extends AbstractClientMsgHandler { ViewResourcesMessage vrm = new ViewResourcesMessage(player); vrm.setGuild(building.getGuild()); - vrm.setWarehouseBuilding(BuildingManager.getBuildingFromCache(building.getCity().warehouse.buildingUID)); + vrm.setWarehouseBuilding(BuildingManager.getBuildingFromCache(building.getCity().warehouse.building.getObjectUUID())); vrm.configure(); Dispatch dispatch = Dispatch.borrow(player, msg); DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); diff --git a/src/engine/net/client/msg/ArcViewAssetTransactionsMsg.java b/src/engine/net/client/msg/ArcViewAssetTransactionsMsg.java index 60de5853..d88b462b 100644 --- a/src/engine/net/client/msg/ArcViewAssetTransactionsMsg.java +++ b/src/engine/net/client/msg/ArcViewAssetTransactionsMsg.java @@ -61,7 +61,7 @@ public class ArcViewAssetTransactionsMsg extends ClientNetMsg { public void configure() { - warehouseBuilding = BuildingManager.getBuilding(this.warehouse.buildingUID); + warehouseBuilding = BuildingManager.getBuilding(this.warehouse.building.getObjectUUID()); transactions = new ArrayList<>(50); if (this.warehouse.transactions.size() > 150) { @@ -78,7 +78,7 @@ public class ArcViewAssetTransactionsMsg extends ClientNetMsg { protected void _serialize(ByteBufferWriter writer) throws SerializationException { writer.putInt(this.transactionID); - writer.putInt(this.warehouse.buildingUID); + writer.putInt(this.warehouse.building.getObjectUUID()); writer.putInt(transactions.size()); //list Size for (Transaction transaction : transactions) { @@ -124,7 +124,7 @@ public class ArcViewAssetTransactionsMsg extends ClientNetMsg { writer.putInt(transaction.getTargetUUID()); //ID writer.putString(name); //Name of depositer/withdrawler or mine name writer.putInt(GameObjectType.Building.ordinal()); //Type - writer.putInt(warehouse.buildingUID); //ID + writer.putInt(warehouse.building.getObjectUUID()); //ID writer.putString(warehouseBuilding.getName()); //warehouse writer.putInt(transaction.getTransactionType().getID()); //79,80 withdrew, 81 mine produced, 82 deposit writer.putInt(transaction.getAmount()); //amount diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 3ec2460c..2249ee90 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -1389,7 +1389,7 @@ public class City extends AbstractWorldObject { ViewResourcesMessage vrm = new ViewResourcesMessage(player); vrm.setGuild(building.getGuild()); - vrm.setWarehouseBuilding(BuildingManager.getBuildingFromCache(building.getCity().warehouse.buildingUID)); + vrm.setWarehouseBuilding(BuildingManager.getBuildingFromCache(building.getCity().warehouse.building.getObjectUUID())); vrm.configure(); Dispatch dispatch = Dispatch.borrow(player, vrm); DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);