X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=dungeon.c;h=73f14764ca588aa1be2dc7cdc67914efa9085115;hb=7e1ef875fcc59af804db2a521339463a73acb64d;hp=62c077272e6b6b06725b13b5a44dd7a2ac8521d5;hpb=844cb056199a25fa1a9bd18c1755a8697ff1f0e9;p=open-adventure.git diff --git a/dungeon.c b/dungeon.c index 62c0772..73f1476 100644 --- a/dungeon.c +++ b/dungeon.c @@ -33,6 +33,7 @@ static long LNLENG; static long LNPOSN; static char INLINE[LINESIZE+1]; static long OLDLOC; +static long MAXDIE; // Storage for what comes out of the database long LINUSE; @@ -556,6 +557,13 @@ void write_hints(FILE* c_file, FILE* header_file, long matrix[][HINTLEN], long d void write_files(FILE* c_file, FILE* header_file) { + int i, MAXDIE; + for (i=0; i<=4; i++) { + long x = 2*i+81; + if(RTEXT[x] != 0) + MAXDIE=i+1; + } + // preprocessor defines for the header fprintf(header_file, "#include \"sizes.h\"\n"); fprintf(header_file, "#define RTXSIZ 277\n"); @@ -568,6 +576,7 @@ void write_files(FILE* c_file, FILE* header_file) fprintf(header_file, "#define TRVSIZ 885\n"); fprintf(header_file, "#define TOKLEN %d\n", TOKLEN); fprintf(header_file, "#define HINTLEN %d\n", HINTLEN); + fprintf(header_file, "#define MAXDIE %d\n", MAXDIE); fprintf(header_file, "\n"); // include the header in the C file