Change the name of the KEY array to avoid an upcoming macro clash.
This commit is contained in:
parent
59243cf8bc
commit
d612b0e6ca
3 changed files with 11 additions and 11 deletions
10
dungeon.c
10
dungeon.c
|
@ -91,7 +91,7 @@ static long LINUSE;
|
||||||
long TRVS;
|
long TRVS;
|
||||||
long TRNVLS;
|
long TRNVLS;
|
||||||
long TABNDX;
|
long TABNDX;
|
||||||
long KEY[NLOCATIONS + 1];
|
long TKEY[NLOCATIONS + 1];
|
||||||
long LINES[LINSIZ + 1];
|
long LINES[LINSIZ + 1];
|
||||||
long TRAVEL[TRVSIZ + 1];
|
long TRAVEL[TRVSIZ + 1];
|
||||||
long KTAB[TABSIZ + 1];
|
long KTAB[TABSIZ + 1];
|
||||||
|
@ -254,8 +254,8 @@ static void read_section3_stuff(FILE* database)
|
||||||
while ((loc = GETNUM(database)) != -1) {
|
while ((loc = GETNUM(database)) != -1) {
|
||||||
long newloc = GETNUM(NULL);
|
long newloc = GETNUM(NULL);
|
||||||
long L;
|
long L;
|
||||||
if (KEY[loc] == 0) {
|
if (TKEY[loc] == 0) {
|
||||||
KEY[loc] = TRVS;
|
TKEY[loc] = TRVS;
|
||||||
} else {
|
} else {
|
||||||
TRAVEL[TRVS - 1] = -TRAVEL[TRVS - 1];
|
TRAVEL[TRVS - 1] = -TRAVEL[TRVS - 1];
|
||||||
}
|
}
|
||||||
|
@ -348,7 +348,7 @@ static int read_database(FILE* database)
|
||||||
* message for game.prop(N)=0. Successive prop messages are
|
* message for game.prop(N)=0. Successive prop messages are
|
||||||
* found by chasing pointers. */
|
* found by chasing pointers. */
|
||||||
for (int I = 1; I <= NLOCATIONS; I++) {
|
for (int I = 1; I <= NLOCATIONS; I++) {
|
||||||
KEY[I] = 0;
|
TKEY[I] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LINUSE = 1;
|
LINUSE = 1;
|
||||||
|
@ -457,7 +457,7 @@ static void write_file(FILE* header_file)
|
||||||
fprintf(header_file, "\n");
|
fprintf(header_file, "\n");
|
||||||
|
|
||||||
// content variables
|
// content variables
|
||||||
write_1d(header_file, KEY, NLOCATIONS + 1, "KEY");
|
write_1d(header_file, TKEY, NLOCATIONS + 1, "TKEY");
|
||||||
write_1d(header_file, TRAVEL, TRVSIZ + 1, "TRAVEL");
|
write_1d(header_file, TRAVEL, TRVSIZ + 1, "TRAVEL");
|
||||||
write_1d(header_file, KTAB, TABSIZ + 1, "KTAB");
|
write_1d(header_file, KTAB, TABSIZ + 1, "KTAB");
|
||||||
write_1d(header_file, ATAB, TABSIZ + 1, "ATAB");
|
write_1d(header_file, ATAB, TABSIZ + 1, "ATAB");
|
||||||
|
|
4
init.c
4
init.c
|
@ -23,8 +23,8 @@ void initialise(void)
|
||||||
|
|
||||||
for (int i = 1; i <= NLOCATIONS; i++) {
|
for (int i = 1; i <= NLOCATIONS; i++) {
|
||||||
game.abbrev[i] = 0;
|
game.abbrev[i] = 0;
|
||||||
if (!(locations[i].description.big == 0 || KEY[i] == 0)) {
|
if (!(locations[i].description.big == 0 || TKEY[i] == 0)) {
|
||||||
int k = KEY[i];
|
int k = TKEY[i];
|
||||||
if (MOD(labs(TRAVEL[k]), 1000) == 1)
|
if (MOD(labs(TRAVEL[k]), 1000) == 1)
|
||||||
conditions[i] |= (1 << COND_FORCED);
|
conditions[i] |= (1 << COND_FORCED);
|
||||||
}
|
}
|
||||||
|
|
8
main.c
8
main.c
|
@ -418,7 +418,7 @@ static bool dwarfmove(void)
|
||||||
continue;
|
continue;
|
||||||
/* Fill tk array with all the places this dwarf might go. */
|
/* Fill tk array with all the places this dwarf might go. */
|
||||||
int j = 1;
|
int j = 1;
|
||||||
kk = KEY[game.dloc[i]];
|
kk = TKEY[game.dloc[i]];
|
||||||
if (kk != 0)
|
if (kk != 0)
|
||||||
do {
|
do {
|
||||||
game.newloc = T_DESTINATION(TRAVEL[kk]);
|
game.newloc = T_DESTINATION(TRAVEL[kk]);
|
||||||
|
@ -541,7 +541,7 @@ static void croak(void)
|
||||||
|
|
||||||
static bool playermove(token_t verb, int motion)
|
static bool playermove(token_t verb, int motion)
|
||||||
{
|
{
|
||||||
int scratchloc, k2, kk = KEY[game.loc];
|
int scratchloc, k2, kk = TKEY[game.loc];
|
||||||
game.newloc = game.loc;
|
game.newloc = game.loc;
|
||||||
if (kk == 0)
|
if (kk == 0)
|
||||||
BUG(LOCATION_HAS_NO_TRAVEL_ENTRIES);
|
BUG(LOCATION_HAS_NO_TRAVEL_ENTRIES);
|
||||||
|
@ -564,7 +564,7 @@ static bool playermove(token_t verb, int motion)
|
||||||
scratchloc = T_DESTINATION(TRAVEL[kk]);
|
scratchloc = T_DESTINATION(TRAVEL[kk]);
|
||||||
if (scratchloc != motion) {
|
if (scratchloc != motion) {
|
||||||
if (!SPECIAL(scratchloc)) {
|
if (!SPECIAL(scratchloc)) {
|
||||||
if (FORCED(scratchloc) && T_DESTINATION(TRAVEL[KEY[scratchloc]]) == motion)
|
if (FORCED(scratchloc) && T_DESTINATION(TRAVEL[TKEY[scratchloc]]) == motion)
|
||||||
k2 = kk;
|
k2 = kk;
|
||||||
}
|
}
|
||||||
if (TRAVEL[kk] >= 0) {
|
if (TRAVEL[kk] >= 0) {
|
||||||
|
@ -580,7 +580,7 @@ static bool playermove(token_t verb, int motion)
|
||||||
}
|
}
|
||||||
|
|
||||||
motion = T_MOTION(TRAVEL[kk]);
|
motion = T_MOTION(TRAVEL[kk]);
|
||||||
kk = KEY[game.loc];
|
kk = TKEY[game.loc];
|
||||||
break; /* fall through to ordinary travel */
|
break; /* fall through to ordinary travel */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue