Fix: off-by-one error in movecmd
The for loop which iterates through the list of movement keys in
movecmd(cmd.c) was updated in 5abf948116 to count down to 0 instead of
up to the end of the list. This commit inadvertently introduced an
off-by-one error which started the loop one past the actual end of the
array. On my system this made 'H' stop working as the 'run West' key.
This commit is contained in:
committed by
Pasi Kallinen
parent
bed1645f5b
commit
e8cb683ad0
@@ -3693,7 +3693,7 @@ movecmd(char sym, int mode)
|
||||
char *mvkeys = (mode == MV_WALK) ? g.Cmd.move :
|
||||
((mode == MV_RUN) ? g.Cmd.run : g.Cmd.rush);
|
||||
|
||||
for (d = N_DIRS; d > DIR_ERR; d--) {
|
||||
for (d = N_DIRS - 1; d > DIR_ERR; d--) {
|
||||
if (mode == MV_ANY) {
|
||||
if (sym == g.Cmd.move[d]
|
||||
|| sym == g.Cmd.rush[d]
|
||||
|
||||
Reference in New Issue
Block a user