mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-07-26 23:32:25 +01:00
Merge pull request #1177 from gebulmer/fix/direction-selection
Prevent overflow in setting directions at start
This commit is contained in:
commit
a20c705af2
1 changed files with 2 additions and 1 deletions
|
@ -6353,7 +6353,8 @@ char sym;
|
|||
if(iflags.num_pad) sdp = ndir; else sdp = sdir; /* DICE workaround */
|
||||
|
||||
u.dz = 0;
|
||||
if(!(dp = index(sdp, sym))) return 0;
|
||||
/* sym defaults to null at game start, causing dp - sdp to be 10, overflowing */
|
||||
if(!sym || !(dp = index(sdp, sym))) return 0;
|
||||
u.dx = xdir[dp-sdp];
|
||||
u.dy = ydir[dp-sdp];
|
||||
u.dz = zdir[dp-sdp];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue