From: Eric S. Raymond Date: Fri, 23 Jun 2017 19:50:15 +0000 (-0400) Subject: Eliminate setting of OBJTXT sell for oyster - OBJTXT is now static. X-Git-Tag: 1.1~143 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=ea70341cfeeae6ca648b8bd0425a564c6ab50975;p=open-adventure.git Eliminate setting of OBJTXT sell for oyster - OBJTXT is now static. A necessary step towards getting rid of it. --- diff --git a/actions.c b/actions.c index e3a6caf..2b30de9 100644 --- a/actions.c +++ b/actions.c @@ -689,7 +689,6 @@ static int listen(void) continue; int mi = OBJSND[i] + game.prop[i]; if (i == BIRD) - /* FIXME: Arithmetic on state values */ mi += 3 * game.blooded; pspeak(i, mi, game.zzword); spk = NO_MESSAGE; @@ -812,10 +811,10 @@ static int read(struct command_t command) if (DARK(game.loc)) { rspeak(NO_SEE, command.wd1, command.wd1x); + } else if (command.obj == OYSTER && !game.clshnt && game.closed) { + game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]); } else if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) { rspeak(ACTSPK[command.verb]); - } else if (command.obj == OYSTER && !game.clshnt) { - game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]); } else pspeak(command.obj, OBJTXT[command.obj] + game.prop[command.obj]); return GO_CLEAROBJ; diff --git a/main.c b/main.c index cbcd45c..11d967d 100644 --- a/main.c +++ b/main.c @@ -802,7 +802,6 @@ static bool closecheck(void) game.prop[BOTTLE] = PUT(BOTTLE, LOC_NE, EMPTY_BOTTLE); game.prop[PLANT] = PUT(PLANT, LOC_NE, 0); game.prop[OYSTER] = PUT(OYSTER, LOC_NE, 0); - OBJTXT[OYSTER] = 3; game.prop[LAMP] = PUT(LAMP, LOC_NE, 0); game.prop[ROD] = PUT(ROD, LOC_NE, 0); game.prop[DWARF] = PUT(DWARF, LOC_NE, 0); diff --git a/saveresume.c b/saveresume.c index 1f052e2..cf32746 100644 --- a/saveresume.c +++ b/saveresume.c @@ -24,8 +24,6 @@ struct save_t { long mode; /* not used, must be present for version detection */ long version; struct game_t game; - long bird; - long bivalve; }; struct save_t save; @@ -63,7 +61,6 @@ int suspend(void) save.mode = -1; save.version = VRSION; memcpy(&save.game, &game, sizeof(struct game_t)); - save.bivalve = OBJTXT[OYSTER]; IGNORE(fwrite(&save, sizeof(struct save_t), 1, fp)); fclose(fp); rspeak(RESUME_HELP); @@ -113,7 +110,6 @@ int restore(FILE* fp) rspeak(VERSION_SKEW, save.version / 10, MOD(save.version, 10), VRSION / 10, MOD(VRSION, 10)); } else { memcpy(&game, &save.game, sizeof(struct game_t)); - OBJTXT[OYSTER] = save.bivalve; game.zzword = RNDVOC(3, game.zzword); } return GO_TOP;