X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=dungeon.c;h=a5531473116752dc260e90804c3b1a3067e57ef7;hp=60c91f80c9d5093d7ac9104fb4237a35a954ad94;hb=f9edfc51515853c21418c1d55b681a71681a748c;hpb=b626371b6cd3e338b7476fa4629c7bceec727cc1 diff --git a/dungeon.c b/dungeon.c index 60c91f8..a553147 100644 --- a/dungeon.c +++ b/dungeon.c @@ -91,7 +91,7 @@ static long LINUSE; long TRVS; long TRNVLS; long TABNDX; -long KEY[NLOCATIONS + 1]; +long TKEY[NLOCATIONS + 1]; long LINES[LINSIZ + 1]; long TRAVEL[TRVSIZ + 1]; long KTAB[TABSIZ + 1]; @@ -198,7 +198,7 @@ static long GETNUM(FILE *source) * scanned). If we're at the end of the line or encounter an illegal * character (not a digit, hyphen, or blank), we return 0. */ - long DIGIT, GETNUM, SIGN; + long DIGIT, GETNUM, sign; if (source != NULL) MAPLIN(source); GETNUM = 0; @@ -209,9 +209,9 @@ static long GETNUM(FILE *source) } if (INLINE[LNPOSN] != 9) { - SIGN = 1; + sign = 1; } else { - SIGN = -1; + sign = -1; LNPOSN = LNPOSN + 1; } while (!(LNPOSN > LNLENG || INLINE[LNPOSN] == 0)) { @@ -224,7 +224,7 @@ static long GETNUM(FILE *source) LNPOSN = LNPOSN + 1; } - GETNUM = GETNUM * SIGN; + GETNUM = GETNUM * sign; LNPOSN = LNPOSN + 1; return (GETNUM); } @@ -254,8 +254,8 @@ static void read_section3_stuff(FILE* database) while ((loc = GETNUM(database)) != -1) { long newloc = GETNUM(NULL); long L; - if (KEY[loc] == 0) { - KEY[loc] = TRVS; + if (TKEY[loc] == 0) { + TKEY[loc] = TRVS; } else { 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 * found by chasing pointers. */ for (int I = 1; I <= NLOCATIONS; I++) { - KEY[I] = 0; + TKEY[I] = 0; } LINUSE = 1; @@ -457,7 +457,7 @@ static void write_file(FILE* header_file) fprintf(header_file, "\n"); // 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, KTAB, TABSIZ + 1, "KTAB"); write_1d(header_file, ATAB, TABSIZ + 1, "ATAB");