Browse Source

null check

feature-workorder
FatBoy-DOTC 1 year ago
parent
commit
c3e206e3b1
  1. 7
      src/engine/net/client/handlers/MoveToPointHandler.java

7
src/engine/net/client/handlers/MoveToPointHandler.java

@ -37,10 +37,11 @@ public class MoveToPointHandler extends AbstractClientMsgHandler { @@ -37,10 +37,11 @@ public class MoveToPointHandler extends AbstractClientMsgHandler {
Enum.GameObjectType targetType;
targetType = Enum.GameObjectType.values()[msg.getTargetType()];
switch(targetType){
if(targetType != null) {
switch (targetType) {
case Building:
target = BuildingManager.getBuilding(msg.getTargetID());
if(target == null)
if (target == null)
return true;// early exit for no building pulled
Building targetBuilding = (Building) target;
if (!targetBuilding.isVulnerable() || targetBuilding.getRank() < 0)
@ -49,7 +50,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler { @@ -49,7 +50,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler {
case NPC:
return true;//cannot attack anything other than the 3 above
}
}
MovementManager.movement(msg, pc);
return true;
}

Loading…
Cancel
Save