Browse Source

More itembase refactor

combat-2
MagicBot 8 months ago
parent
commit
3ee0ec1342
  1. 22
      src/engine/net/client/handlers/RepairBuildingMsgHandler.java

22
src/engine/net/client/handlers/RepairBuildingMsgHandler.java

@ -47,21 +47,16 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { @@ -47,21 +47,16 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler {
if (serverZone.playerCityUUID == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE)
return;
City city = City.GetCityFromCache(serverZone.playerCityUUID);
if (city != null) {
if (city != null)
if (city.getBane() != null && city.protectionEnforced == false)
return;
}
//cannot repair mines during 24/7 activity.
if (targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.MINE && Mine.getMineFromTower(targetBuilding.getObjectUUID()).isActive == true) {
if (targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.MINE && Mine.getMineFromTower(targetBuilding.getObjectUUID()).isActive == true)
return;
}
int maxHP = (int) targetBuilding.getMaxHitPoints();
int repairCost = BuildingManager.GetRepairCost(targetBuilding);
@ -94,35 +89,22 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { @@ -94,35 +89,22 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler {
Building targetBuilding;
RepairBuildingMsg msg;
// Member variable assignment
msg = (RepairBuildingMsg) baseMsg;
player = SessionManager.getPlayerCharacter(origin);
if (player == null)
return true;
switch (msg.getType()) {
case 0:
targetBuilding = BuildingManager.getBuildingFromCache(msg.getBuildingID());
RepairBuilding(targetBuilding, origin, msg);
break;
// targetBuilding.createFurniture(item.getItemBase().getUseID(), 0, msg.getFurnitureLoc(), Vector3f.ZERO, 0, player);
}
// dispatch = Dispatch.borrow(player, baseMsg);
// DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
return true;
}
}

Loading…
Cancel
Save