Skip to content

Commit

Permalink
Cancel targeted attack on dead targets
Browse files Browse the repository at this point in the history
Fixes #962
  • Loading branch information
AJenbo committed Jul 19, 2021
1 parent 4260d4c commit 6227c0a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2965,13 +2965,21 @@ 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;
case ACTION_ATTACKPLR:
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;
Expand Down

0 comments on commit 6227c0a

Please sign in to comment.