Browse Source

null check for building pulled

feature-workorder
FatBoy-DOTC 1 year ago
parent
commit
545cb4cddf
  1. 2
      src/engine/net/client/handlers/AttackCmdMsgHandler.java

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

@ -58,6 +58,8 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
break; break;
case Building: case Building:
target = BuildingManager.getBuilding(msg.getTargetID()); target = BuildingManager.getBuilding(msg.getTargetID());
if(target == null)
return true;// early exit for no building pulled
Building targetBuilding = (Building) target; Building targetBuilding = (Building) target;
if (!targetBuilding.isVulnerable() || targetBuilding.getRank() < 0) if (!targetBuilding.isVulnerable() || targetBuilding.getRank() < 0)
return true;// cannot attack destroyed building or protected building return true;// cannot attack destroyed building or protected building

Loading…
Cancel
Save