forked from MagicBane/Server
can no longer run to invalid targets
This commit is contained in:
@@ -56,9 +56,12 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
|
||||
case Building:
|
||||
target = BuildingManager.getBuilding(msg.getTargetID());
|
||||
break;
|
||||
case NPC:
|
||||
target = NPC.getNPC(msg.getTargetID());
|
||||
break;
|
||||
}
|
||||
|
||||
if(target == null) {
|
||||
playerCharacter.setCombatTarget(null);
|
||||
return true; // cannot attack a null target
|
||||
}
|
||||
//set sources target
|
||||
|
||||
Reference in New Issue
Block a user