Browse Source

Cancel targeted attack on dead targets

Fixes #962
pull/2426/head
Anders Jenbo 5 years ago
parent
commit
6227c0a012
  1. 8
      Source/player.cpp

8
Source/player.cpp

@ -2965,6 +2965,10 @@ void CheckNewPath(int pnum, bool pmWillBeCalled)
case ACTION_RATTACKMON:
case ACTION_SPELLMON:
monster = &Monsters[targetId];
if ((monster->_mhitpoints >> 6) <= 0) {
player.Stop();
return;
}
if (player.destAction == ACTION_ATTACKMON)
MakePlrPath(pnum, monster->position.future, false);
break;
@ -2972,6 +2976,10 @@ void CheckNewPath(int pnum, bool pmWillBeCalled)
case ACTION_RATTACKPLR:
case ACTION_SPELLPLR:
target = &Players[targetId];
if ((target->_pHitPoints >> 6) <= 0) {
player.Stop();
return;
}
if (player.destAction == ACTION_ATTACKPLR)
MakePlrPath(pnum, target->position.future, false);
break;

Loading…
Cancel
Save