More globals to the game structure.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 24 May 2017 00:34:53 +0000 (20:34 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 24 May 2017 00:34:53 +0000 (20:34 -0400)
actions1.c
main.c
main.h
share.h

index 280a4f79a99a56c428e8454c288cf2257fd58d38..0bbe90e071d9b33a8e0b3b0a280229ec8d277943 100644 (file)
@@ -499,7 +499,7 @@ L8305:      DATIME(I,K);
        SAVWDS(game.knfloc,game.limit,LL,game.lmwarn,LOC,game.newloc,game.numdie);
        SAVWDS(OBJ,game.oldlc2,game.oldloc,game.oldobj,game.panic,game.saved,game.setup);
        SAVWDS(game.spk,game.tally,game.thresh,game.trndex,game.trnluz,game.turns,OBJTXT[OYSTER]);
-       SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,ZZWORD,OBJSND[BIRD]);
+       SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,game.zzword,OBJSND[BIRD]);
        SAVWDS(OBJTXT[SIGN],CLSHNT,game.novice,K,K,K,K);
        SAVARR(ABB,LOCSIZ);
        SAVARR(ATLOC,LOCSIZ);
@@ -515,7 +515,7 @@ L8305:      DATIME(I,K);
        SAVWRD(KK,K);
        if(K != 0) goto L8318;
        K=NUL;
-       ZZWORD=RNDVOC(3,ZZWORD-MESH*2)+MESH*2;
+       game.zzword=RNDVOC(3,game.zzword-MESH*2)+MESH*2;
        if(KK > 0) return(8);
        RSPEAK(266);
        exit(0);
@@ -562,7 +562,7 @@ L8330:      game.spk=228;
        RSPEAK(IABS(K));
        if(K < 0) return(2012);
        game.spk=0;
-L8332: SETPRM(1,ZZWORD-MESH*2,0);
+L8332: SETPRM(1,game.zzword-MESH*2,0);
        /* 8335 */ for (I=1; I<=100; I++) {
        if(!HERE(I) || OBJSND[I] == 0 || PROP[I] < 0) goto L8335;
        PSPEAK(I,OBJSND[I]+PROP[I]);
diff --git a/main.c b/main.c
index 0ccfccefa3dbc2dbf31e09748902972c0bbb443e..8cce7c5247dce8549d74c0077767e8c937b91ba7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -37,8 +37,7 @@ long ACTVERB[36], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
                STREAM, TABNDX, THROW, TK[21], TRAVEL[886], TRIDNT,
                TRNSIZ = 5, TRNVAL[6], TRNVLS, TROLL, TROLL2, TRVS,
                TRVSIZ = 885, TTEXT[6], URN, V1, V2, VASE, VEND, VERB,
-               VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X,
-               ZZWORD;
+               VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X;
 struct game_t game = {.blklin = true};
 FILE  *logfp;
 bool oldstyle = false;
@@ -117,7 +116,7 @@ int main(int argc, char *argv[]) {
 
 L1:    game.setup= -1;
        I=RAN(-1);
-       ZZWORD=RNDVOC(3,0)+MESH*2;
+       game.zzword=RNDVOC(3,0)+MESH*2;
        game.novice=YES(stdin, 65,1,0);
        game.newloc=1;
        LOC=1;
diff --git a/main.h b/main.h
index c7b40b565189d83cea66a48b39879e34d718cd6f..5af50f3a7625c62b1be79dc393dac80705c058fa 100644 (file)
--- a/main.h
+++ b/main.h
@@ -48,6 +48,7 @@ struct game_t {
     long turns;
     /* more state will go here */
     long wzdark;
+    long zzword;
     /* more state will go here */
     long novice;
 };
diff --git a/share.h b/share.h
index 4f5b5bad38b41714a907d298e39753d337c43645..a30719152c88998b372aa976c816449941c16a59 100644 (file)
--- a/share.h
+++ b/share.h
@@ -19,5 +19,4 @@ extern long ACTVERB[], AMBER, ATTACK, AXE, BACK, BATTER, BEAR,
    STREAM, TABNDX, THROW, TK[], TRAVEL[], TRIDNT,
    TRNSIZ, TRNVAL[], TRNVLS, TROLL, TROLL2, TRVS,
    TRVSIZ, TTEXT[], URN, V1, V2, VASE, VEND, VERB,
-   VOLCAN, VRBSIZ, VRSION, WATER, WD1, WD1X, WD2, WD2X,
-   ZZWORD;
+   VOLCAN, VRBSIZ, VRSION, WATER, WD1, WD1X, WD2, WD2X;