Browse Source

missiles: add BUGFIX for PutMissile

Prior to this commit, if the player was standing on coodinate with
x=0 or y=0, no missile would be created when casting a spell. This
is due to an off-by-one when doing bounds-checking.
pull/5295/head
Robin Eklind 5 years ago committed by Anders Jenbo
parent
commit
721460e375
  1. 1
      Source/missiles.cpp

1
Source/missiles.cpp

@ -462,6 +462,7 @@ void PutMissile(int i)
x = missile[i]._mix;
y = missile[i]._miy;
// BUGFIX: should be `x < 0 || y < 0`, was `x <= 0 || y <= 0`.
if (x <= 0 || y <= 0 || x >= MAXDUNX || y >= MAXDUNY)
missile[i]._miDelFlag = TRUE;
if (!missile[i]._miDelFlag) {

Loading…
Cancel
Save