Browse Source

null check for target

feature-workorder
FatBoy-DOTC 1 year ago
parent
commit
8acfff7faa
  1. 4
      src/engine/net/client/handlers/AttackCmdMsgHandler.java

4
src/engine/net/client/handlers/AttackCmdMsgHandler.java

@ -63,6 +63,10 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
return true; //cannot attack other things return true; //cannot attack other things
} }
if(target == null) {
playerCharacter.setCombatTarget(target);
return true; // cannot attack a null target
}
//set sources target //set sources target
playerCharacter.setCombatTarget(target); playerCharacter.setCombatTarget(target);

Loading…
Cancel
Save