Magic-number elimination.
This commit is contained in:
parent
f165aabad8
commit
6d571c18b8
1 changed files with 3 additions and 1 deletions
4
main.c
4
main.c
|
@ -25,6 +25,8 @@
|
||||||
#include "linenoise/linenoise.h"
|
#include "linenoise/linenoise.h"
|
||||||
#include "newdb.h"
|
#include "newdb.h"
|
||||||
|
|
||||||
|
#define DIM(a) (sizeof(a)/sizeof(a[0]))
|
||||||
|
|
||||||
struct game_t game;
|
struct game_t game;
|
||||||
|
|
||||||
long LNLENG, LNPOSN;
|
long LNLENG, LNPOSN;
|
||||||
|
@ -414,7 +416,7 @@ static bool dwarfmove(void)
|
||||||
!INDEEP(game.newloc) ||
|
!INDEEP(game.newloc) ||
|
||||||
game.newloc == game.odloc[i] ||
|
game.newloc == game.odloc[i] ||
|
||||||
(j > 1 && game.newloc == tk[j - 1]) ||
|
(j > 1 && game.newloc == tk[j - 1]) ||
|
||||||
j >= 20 ||
|
j >= DIM(tk) - 1 ||
|
||||||
game.newloc == game.dloc[i] ||
|
game.newloc == game.dloc[i] ||
|
||||||
FORCED(game.newloc) ||
|
FORCED(game.newloc) ||
|
||||||
(i == PIRATE && CNDBIT(game.newloc, COND_NOARRR)) ||
|
(i == PIRATE && CNDBIT(game.newloc, COND_NOARRR)) ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue