Browse Source

check for null target when cancelling jobs

combat-3
FatBoy-DOTC 6 months ago
parent
commit
a348056c86
  1. 4
      src/engine/net/client/handlers/AttackCmdMsgHandler.java

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

@ -87,7 +87,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
//check if we are changing targets, cancel outstanding jobs if so //check if we are changing targets, cancel outstanding jobs if so
if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.RHELD)) { if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.RHELD)) {
AttackJob ajR = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).getJob()); AttackJob ajR = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).getJob());
if(!ajR.target.equals(target)){ if(ajR.target != null && !ajR.target.equals(target)){
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob(); playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob();
addedDelay = ajR.getStopTime() - System.currentTimeMillis(); addedDelay = ajR.getStopTime() - System.currentTimeMillis();
}else{ }else{
@ -97,7 +97,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) { if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) {
AttackJob ajL = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).getJob()); AttackJob ajL = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).getJob());
if(!ajL.target.equals(target)){ if(ajL.target != null && !ajL.target.equals(target)){
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob(); playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob();
addedDelay = ajL.getStopTime() - System.currentTimeMillis(); addedDelay = ajL.getStopTime() - System.currentTimeMillis();
}else{ }else{

Loading…
Cancel
Save