From: Eric S. Raymond Date: Wed, 7 Jun 2017 09:24:48 +0000 (-0400) Subject: Bring SETUP variable into game state block X-Git-Tag: 1.1~586 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=7f4cff11889363b959a9987e92c9f62244397574;p=open-adventure.git Bring SETUP variable into game state block Saved separately because the kogic around this variable looks a bit dubious and may need review. --- diff --git a/actions1.c b/actions1.c index 3fabfbd..7f00bda 100644 --- a/actions1.c +++ b/actions1.c @@ -536,7 +536,7 @@ L8305: DATIME(&I,&K); SAVWDS(game.abbnum,game.blklin,game.bonus,game.clock1,game.clock2,game.closed,game.closng); SAVWDS(game.detail,game.dflag,game.dkill,game.dtotal,game.foobar,game.holdng,game.iwest); 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,SETUP); + SAVWDS(OBJ,game.oldlc2,game.oldloc,game.oldobj,game.panic,game.saved,game.setup); SAVWDS(SPK,game.tally,game.thresh,game.trndex,game.trnluz,game.turns,OBJTXT[OYSTER]); SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,game.zzword,OBJSND[BIRD]); SAVWDS(OBJTXT[SIGN],game.clshnt,game.novice,K,K,K,K); diff --git a/advent.h b/advent.h index 85d9026..0f06ccc 100644 --- a/advent.h +++ b/advent.h @@ -43,6 +43,7 @@ struct game_t { long oldobj; long panic; long saved; + long setup; long tally; long thresh; long trndex; @@ -133,7 +134,7 @@ extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, OGRE, OIL, OLDOBJ, OYSTER, PANIC, PEARL, PILLOW, PLANT, PLANT2, PROP[], PYRAM, RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY, - SCORE, SECT, SETUP, SIGN, SNAKE, SPK, STEPS, STICK, + SCORE, SECT, SIGN, SNAKE, SPK, STEPS, STICK, STREAM, THROW, TK[], TRIDNT, TROLL, TROLL2, URN, V1, V2, VASE, VEND, VERB, VOLCAN, VRSION, WATER, WD1, WD1X, WD2, WD2X; diff --git a/init.c b/init.c index 12d3ad1..5425b7a 100644 --- a/init.c +++ b/init.c @@ -392,7 +392,7 @@ L1106: /*etc*/ ; game.closed=false; game.clshnt=false; game.novice=false; - SETUP=1; + game.setup=1; game.blklin=true; /* if we can ever think of how, we should save it at this point */ diff --git a/main.c b/main.c index 8a58c57..21a8fa8 100644 --- a/main.c +++ b/main.c @@ -16,8 +16,7 @@ struct game_t game; long ATLOC[186], FIXED[NOBJECTS+1], LINK[NOBJECTS*2 + 1], LNLENG, LNPOSN, - PARMS[26], PLACE[NOBJECTS+1], - SETUP = 0; + PARMS[26], PLACE[NOBJECTS+1]; char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[129], MAP2[129]; long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, @@ -110,8 +109,8 @@ int main(int argc, char *argv[]) { /* Read the database if we have not yet done so */ MAP2[1] = 0; - if(!SETUP)initialise(); - if(SETUP > 0) goto L1; + if (!game.setup)initialise(); + if(game.setup > 0) goto L1; /* Unlike earlier versions, adventure is no longer restartable. (This * lets us get away with modifying things such as OBJSND(BIRD) without @@ -123,7 +122,7 @@ int main(int argc, char *argv[]) { /* Start-up, dwarf stuff */ -L1: SETUP= -1; +L1: game.setup= -1; I=0; game.zzword=RNDVOC(3,0); game.novice=YES(stdin, 65,1,0);