Browse Source

null check

combat-2
FatBoy-DOTC 1 year ago
parent
commit
c3e206e3b1
  1. 3
      src/engine/net/client/handlers/MoveToPointHandler.java

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

@ -37,6 +37,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler {
Enum.GameObjectType targetType; Enum.GameObjectType targetType;
targetType = Enum.GameObjectType.values()[msg.getTargetType()]; targetType = Enum.GameObjectType.values()[msg.getTargetType()];
if(targetType != null) {
switch (targetType) { switch (targetType) {
case Building: case Building:
target = BuildingManager.getBuilding(msg.getTargetID()); target = BuildingManager.getBuilding(msg.getTargetID());
@ -49,7 +50,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler {
case NPC: case NPC:
return true;//cannot attack anything other than the 3 above return true;//cannot attack anything other than the 3 above
} }
}
MovementManager.movement(msg, pc); MovementManager.movement(msg, pc);
return true; return true;
} }

Loading…
Cancel
Save