Browse Source

use target from message in move to point

feature-workorder
FatBoy-DOTC 1 year ago
parent
commit
13644fd308
  1. 12
      src/engine/net/client/handlers/MoveToPointHandler.java

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

@ -33,23 +33,17 @@ public class MoveToPointHandler extends AbstractClientMsgHandler { @@ -33,23 +33,17 @@ public class MoveToPointHandler extends AbstractClientMsgHandler {
if (pc == null)
return false;
AbstractWorldObject target;
AbstractWorldObject target = null;
Enum.GameObjectType targetType;
targetType = Enum.GameObjectType.values()[msg.getTargetType()];
switch(targetType){
case Mob:
target = Mob.getMob(msg.getTargetID());
break;
case PlayerCharacter:
target = PlayerCharacter.getPlayerCharacter(msg.getTargetID());
break;
case Building:
target = BuildingManager.getBuilding(msg.getTargetID());
break;
default:
target = null;
case NPC:
target = NPC.getNPC(msg.getTargetID());
break;
}

Loading…
Cancel
Save