projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Magic-number elimination.
[open-adventure.git]
/
main.c
diff --git
a/main.c
b/main.c
index 733027f70eca8160e3813c60aaa4203c6c85d522..ad2fdb1c16ae600391696c3e6601df623101d2f9 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-25,6
+25,8
@@
#include "linenoise/linenoise.h"
#include "newdb.h"
#include "linenoise/linenoise.h"
#include "newdb.h"
+#define DIM(a) (sizeof(a)/sizeof(a[0]))
+
struct game_t game;
long LNLENG, LNPOSN;
struct game_t game;
long LNLENG, LNPOSN;
@@
-414,7
+416,7
@@
static bool dwarfmove(void)
!INDEEP(game.newloc) ||
game.newloc == game.odloc[i] ||
(j > 1 && game.newloc == tk[j - 1]) ||
!INDEEP(game.newloc) ||
game.newloc == game.odloc[i] ||
(j > 1 && game.newloc == tk[j - 1]) ||
- j >=
20
||
+ j >=
DIM(tk) - 1
||
game.newloc == game.dloc[i] ||
FORCED(game.newloc) ||
(i == PIRATE && CNDBIT(game.newloc, COND_NOARRR)) ||
game.newloc == game.dloc[i] ||
FORCED(game.newloc) ||
(i == PIRATE && CNDBIT(game.newloc, COND_NOARRR)) ||