From ca6e079053fc036746eca639824ed848117cad3c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 10 Sep 2023 15:51:25 -0500 Subject: [PATCH] fresh start --- .../client/handlers/AttackCmdMsgHandler.java | 7 +---- .../client/handlers/MoveToPointHandler.java | 30 ++----------------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/src/engine/net/client/handlers/AttackCmdMsgHandler.java b/src/engine/net/client/handlers/AttackCmdMsgHandler.java index 8f36c9fa..141ed7cb 100644 --- a/src/engine/net/client/handlers/AttackCmdMsgHandler.java +++ b/src/engine/net/client/handlers/AttackCmdMsgHandler.java @@ -41,7 +41,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { if (playerCharacter == null) return true; - AbstractWorldObject target; + AbstractWorldObject target = null; Enum.GameObjectType targetType; targetType = Enum.GameObjectType.values()[msg.getTargetType()]; @@ -56,11 +56,6 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { case Building: target = BuildingManager.getBuilding(msg.getTargetID()); break; - case NPC: - target = NPC.getNPC(msg.getTargetID()); - break; - default: - return true;//cannot attack anything other than the 3 above } if(target == null) { diff --git a/src/engine/net/client/handlers/MoveToPointHandler.java b/src/engine/net/client/handlers/MoveToPointHandler.java index e29d5a62..5be53e00 100644 --- a/src/engine/net/client/handlers/MoveToPointHandler.java +++ b/src/engine/net/client/handlers/MoveToPointHandler.java @@ -37,41 +37,15 @@ public class MoveToPointHandler extends AbstractClientMsgHandler { Enum.GameObjectType targetType; targetType = Enum.GameObjectType.values()[msg.getTargetType()]; - switch(targetType){ case Building: - target = BuildingManager.getBuilding(msg.getTargetID()); + int i = 1; break; case NPC: - target = NPC.getNPC(msg.getTargetID()); + int j = 1; break; } - if(target != null) { - switch (target.getObjectType()) { - case Building: - target = BuildingManager.getBuilding(msg.getTargetID()); - if (target == null) { - pc.teleport(pc.loc); - msg.setEndCoord(pc.loc); - origin.sendMsg(msg); - return true;// early exit for no building pulled - } - Building targetBuilding = (Building) target; - if (!targetBuilding.isVulnerable() || targetBuilding.getRank() < 0) { - pc.teleport(pc.loc); - msg.setEndCoord(pc.loc); - origin.sendMsg(msg); - return true;// cannot attack destroyed building or protected building - } - break; - case NPC: - pc.teleport(pc.loc); - msg.setEndCoord(pc.loc); - origin.sendMsg(msg); - return true;//cannot attack anything other than the 3 above - } - } MovementManager.movement(msg, pc); return true; }