Block all non-siege building placement while the city has a bane
Moves the warehouse-only check into validateBuildingPlacement, which every city asset placement except siege equipment and trees passes through. Matches client error 74, "Only buildings of war may be placed during a bane". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9db194889f
commit
6ef987b7c6
1 file changed
+11
-10
@@ -135,6 +135,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
private static boolean validateBuildingPlacement(Zone serverZone, PlaceAssetMsg msg, ClientConnection origin, PlayerCharacter player, PlacementInfo placementInfo) {
|
||||
|
||||
Bane bane;
|
||||
|
||||
if (serverZone.guild_zone == false) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 52, player.getName());
|
||||
return false;
|
||||
@@ -205,6 +207,15 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Siege equipment has its own validation and never reaches here
|
||||
|
||||
bane = city.getBane();
|
||||
|
||||
if (bane != null) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 74, ""); //"Only buildings of war may be placed during a bane"
|
||||
return false;
|
||||
}
|
||||
|
||||
if (placementCollisionCheck(serverZone, origin, placementInfo)) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 3, ""); // Conflict between proposed assets
|
||||
return false;
|
||||
@@ -496,7 +507,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
Zone serverZone;
|
||||
City cityObject;
|
||||
Bane bane;
|
||||
PlacementInfo buildingList;
|
||||
|
||||
// Retrieve the building details we're placing
|
||||
@@ -533,15 +543,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
// A rebuilt warehouse would orphan the destroyed warehouse's loot
|
||||
|
||||
bane = cityObject.getBane();
|
||||
|
||||
if (bane != null) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 74, ""); //"Only buildings of war may be placed during a bane"
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the warehouse object and it's entry in the database
|
||||
|
||||
if (createWarehouse(player, msg.getFirstPlacementInfo(), serverZone) == false) {
|
||||
|
||||
Reference in new issue
Block a user