Localize KK.
This commit is contained in:
parent
8d90b03ee4
commit
dad1df9796
3 changed files with 10 additions and 10 deletions
11
actions1.c
11
actions1.c
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int action(FILE *input, long STARTAT, long verb, long obj) {
|
int action(FILE *input, long STARTAT, long verb, long obj) {
|
||||||
|
int kk;
|
||||||
switch(STARTAT) {
|
switch(STARTAT) {
|
||||||
case 4000: goto L4000;
|
case 4000: goto L4000;
|
||||||
case 4090: goto L4090;
|
case 4090: goto L4090;
|
||||||
|
@ -517,14 +518,14 @@ L8300: SPK=201;
|
||||||
RSPEAK(260);
|
RSPEAK(260);
|
||||||
if(!YES(input,200,54,54)) return(2012);
|
if(!YES(input,200,54,54)) return(2012);
|
||||||
game.saved=game.saved+5;
|
game.saved=game.saved+5;
|
||||||
KK= -1;
|
kk= -1;
|
||||||
|
|
||||||
/* This next part is shared with the "resume" code. The two cases are
|
/* This next part is shared with the "resume" code. The two cases are
|
||||||
* distinguished by the value of kk (-1 for suspend, +1 for resume). */
|
* distinguished by the value of kk (-1 for suspend, +1 for resume). */
|
||||||
|
|
||||||
L8305: DATIME(&I,&K);
|
L8305: DATIME(&I,&K);
|
||||||
K=I+650*K;
|
K=I+650*K;
|
||||||
SAVWRD(KK,K);
|
SAVWRD(kk,K);
|
||||||
K=VRSION;
|
K=VRSION;
|
||||||
SAVWRD(0,K);
|
SAVWRD(0,K);
|
||||||
if(K != VRSION) goto L8312;
|
if(K != VRSION) goto L8312;
|
||||||
|
@ -552,17 +553,17 @@ L8305: DATIME(&I,&K);
|
||||||
SAVARR(game.odloc,NDWARVES);
|
SAVARR(game.odloc,NDWARVES);
|
||||||
SAVARR(game.place,NOBJECTS);
|
SAVARR(game.place,NOBJECTS);
|
||||||
SAVARR(game.prop,NOBJECTS);
|
SAVARR(game.prop,NOBJECTS);
|
||||||
SAVWRD(KK,K);
|
SAVWRD(kk,K);
|
||||||
if(K != 0) goto L8318;
|
if(K != 0) goto L8318;
|
||||||
K=NUL;
|
K=NUL;
|
||||||
game.zzword=RNDVOC(3,game.zzword);
|
game.zzword=RNDVOC(3,game.zzword);
|
||||||
if(KK > 0) return(8);
|
if(kk > 0) return(8);
|
||||||
RSPEAK(266);
|
RSPEAK(266);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
/* Resume. Read a suspended game back from a file. */
|
/* Resume. Read a suspended game back from a file. */
|
||||||
|
|
||||||
L8310: KK=1;
|
L8310: kk=1;
|
||||||
if(game.loc == 1 && game.abbrev[1] == 1) goto L8305;
|
if(game.loc == 1 && game.abbrev[1] == 1) goto L8305;
|
||||||
RSPEAK(268);
|
RSPEAK(268);
|
||||||
if(!YES(input,200,54,54)) return(2012);
|
if(!YES(input,200,54,54)) return(2012);
|
||||||
|
|
5
advent.h
5
advent.h
|
@ -134,9 +134,8 @@ extern void score(long);
|
||||||
extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR,
|
extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR,
|
||||||
BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
|
BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
|
||||||
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
||||||
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
|
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD, GRATE, HINT, I, INVENT,
|
||||||
GRATE, HINT, I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
|
IGO, J, JADE, K, K2, KEYS, KNIFE, L, LAMP, LOCK, LOOK,
|
||||||
KNIFE, L, LAMP, LOCK, LOOK,
|
|
||||||
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR, NUGGET, NUL,
|
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR, NUGGET, NUL,
|
||||||
OGRE, OIL, OLDOBJ, OYSTER, PANIC, PEARL, PILLOW, PLANT, PLANT2, PYRAM,
|
OGRE, OIL, OLDOBJ, OYSTER, PANIC, PEARL, PILLOW, PLANT, PLANT2, PYRAM,
|
||||||
RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY,
|
RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY,
|
||||||
|
|
4
main.c
4
main.c
|
@ -21,7 +21,7 @@ long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
|
||||||
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
|
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
|
||||||
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
||||||
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
|
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
|
||||||
GRATE, HINT, I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
|
GRATE, HINT, I, INVENT, IGO, J, JADE, K, K2, KEYS,
|
||||||
KNIFE, L, LAMP, LOCK, LOOK, MAGZIN, MAXDIE, MAXTRS,
|
KNIFE, L, LAMP, LOCK, LOOK, MAGZIN, MAXDIE, MAXTRS,
|
||||||
MESSAG, MIRROR, MXSCOR, NUGGET, NUL, OGRE, OIL, OYSTER,
|
MESSAG, MIRROR, MXSCOR, NUGGET, NUL, OGRE, OIL, OYSTER,
|
||||||
PEARL, PILLOW, PLANT, PLANT2, PYRAM, RESER, ROD, ROD2,
|
PEARL, PILLOW, PLANT, PLANT2, PYRAM, RESER, ROD, ROD2,
|
||||||
|
@ -153,7 +153,7 @@ static bool fallback_handler(char *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool do_command(FILE *cmdin) {
|
static bool do_command(FILE *cmdin) {
|
||||||
long LL, KQ, VERB;
|
long LL, KQ, VERB, KK;
|
||||||
long obj;
|
long obj;
|
||||||
|
|
||||||
/* Can't leave cave once it's closing (except by main office). */
|
/* Can't leave cave once it's closing (except by main office). */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue