null check

This commit is contained in:
2023-09-10 14:09:48 -05:00
parent 04147e11cc
commit c3e206e3b1
@@ -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;
} }