Browse Source

Cannot Abandon Tree if You Own a Bane : Cannot Abandon Tree if you are a nation

master
FatBoy-DOTC 2 years ago
parent
commit
657cc0cf9e
  1. 18
      src/engine/net/client/handlers/AbandonAssetMsgHandler.java

18
src/engine/net/client/handlers/AbandonAssetMsgHandler.java

@ -12,6 +12,8 @@ import engine.net.client.msg.ErrorPopupMsg; @@ -12,6 +12,8 @@ import engine.net.client.msg.ErrorPopupMsg;
import engine.objects.*;
import org.pmw.tinylog.Logger;
import java.util.concurrent.ConcurrentHashMap;
/*
* @Author:
* @Summary: Processes application protocol message which processes
@ -92,7 +94,23 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler { @@ -92,7 +94,23 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler {
// Trees require special handling beyond an individual building
if ((building.getBlueprint().getBuildingGroup() == BuildingGroup.TOL))
{
// CHECK IF GUILD HAS A BANE DROPPED
City city = ZoneManager.getCityAtLocation(building.getLoc());
if(city.getGuild().isNation() == true)
{
//nations cant abandon their tree
ErrorPopupMsg.sendErrorMsg(player, "Nations Cannot Abandon Their Capital!");
return true;
}
if(Bane.getBaneByAttackerGuild(city.getGuild()) != null)
{
ErrorPopupMsg.sendErrorMsg(player, "You Cannot Abandon Your Tree With An Active Siege!");
return true;
}
AbandonAllCityObjects(player, building);
}
else
AbandonSingleAsset(player, building);

Loading…
Cancel
Save