Browse Source

FOURTH AFTER ROLLBACK: error catching for attempt ot upgrade warehouses

lakebane-master
FatBoy-DOTC 6 months ago
parent
commit
58cf778ce4
  1. 2
      src/engine/net/client/handlers/UpgradeAssetMsgHandler.java
  2. 4
      src/engine/net/client/msg/ManageCityAssetsMsg.java

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

@ -66,6 +66,8 @@ public class UpgradeAssetMsgHandler extends AbstractClientMsgHandler { @@ -66,6 +66,8 @@ public class UpgradeAssetMsgHandler extends AbstractClientMsgHandler {
Logger.error("Attempt to upgrade null building by " + player.getName());
return true;
}
if(buildingToRank.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.WAREHOUSE))
return true;
// Early exit for building that is already ranking

4
src/engine/net/client/msg/ManageCityAssetsMsg.java

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
package engine.net.client.msg;
import engine.Enum;
import engine.Enum.*;
import engine.gameManager.BuildingManager;
import engine.gameManager.ZoneManager;
@ -530,6 +531,9 @@ public class ManageCityAssetsMsg extends ClientNetMsg { @@ -530,6 +531,9 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
this.upgradeCost = Integer.MAX_VALUE;
else if (building.getRank() == building.getBlueprint().getMaxRank())
this.upgradeCost = Integer.MAX_VALUE;
else
if(building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.WAREHOUSE))
this.upgradeCost = Integer.MAX_VALUE;
else
this.upgradeCost = building.getBlueprint().getRankCost(Math.min(building.getRank() + 1, 7));

Loading…
Cancel
Save