Comment polishing.

This commit is contained in:
Eric S. Raymond 2017-07-11 04:15:57 -04:00
parent de3be760b6
commit 00cf2a9373
2 changed files with 13 additions and 11 deletions

View file

@ -903,7 +903,11 @@ static int listen(void)
game.prop[i] < 0) game.prop[i] < 0)
continue; continue;
int mi = game.prop[i]; int mi = game.prop[i];
/* FIXME: Weird magic on object states */ /* (ESR) Some unpleasant magic on object states here. Ideally
* we'd have liked the bird to be a normal object that we can
* use state_change() on; can't do it, because there are
* actually two different series of per-state birdsounds
* depending on whether player has drunk dragon's blood. */
if (i == BIRD) if (i == BIRD)
mi += 3 * game.blooded; mi += 3 * game.blooded;
long packed_zzword = token_to_packed(game.zzword); long packed_zzword = token_to_packed(game.zzword);

18
main.c
View file

@ -246,12 +246,12 @@ static bool spotted_by_pirate(int i)
if (i != PIRATE) if (i != PIRATE)
return false; return false;
/* The pirate's spotted him. He leaves him alone once we've /* The pirate's spotted him. Pirate leaves him alone once we've
* found chest. K counts if a treasure is here. If not, and * found chest. K counts if a treasure is here. If not, and
* tally=1 for an unseen chest, let the pirate be spotted. Note * tally=1 for an unseen chest, let the pirate be spotted. Note
* that game.place[CHEST] = LOC_NOWHERE might mean that he's thrown * that game.place[CHEST] = LOC_NOWHERE might mean that he's thrown
* it to the troll, but in that case he's seen the chest * it to the troll, but in that case he's seen the chest
* (game.prop=0). */ * (game.prop[CHEST] == STATE_FOUND). */
if (game.loc == game.chloc || if (game.loc == game.chloc ||
game.prop[CHEST] != STATE_NOTFOUND) game.prop[CHEST] != STATE_NOTFOUND)
return true; return true;
@ -321,15 +321,14 @@ static bool dwarfmove(void)
* variables. Remember sixth dwarf is pirate and is thus * variables. Remember sixth dwarf is pirate and is thus
* very different except for motion rules. */ * very different except for motion rules. */
/* First off, don't let the dwarves follow him into a pit or /* First off, don't let the dwarves follow him into a pit or a
* a wall. Activate the whole mess the first time he gets as * wall. Activate the whole mess the first time he gets as far
* far as the hall of mists (loc 15). If game.newloc is * as the Hall of Mists (what INDEEP() tests). If game.newloc
* forbidden to pirate (in particular, if it's beyond the * is forbidden to pirate (in particular, if it's beyond the
* troll bridge), bypass dwarf stuff. That way pirate can't * troll bridge), bypass dwarf stuff. That way pirate can't
* steal return toll, and dwarves can't meet the bear. Also * steal return toll, and dwarves can't meet the bear. Also
* means dwarves won't follow him into dead end in maze, but * means dwarves won't follow him into dead end in maze, but
* c'est la vie. They'll wait for him outside the dead * c'est la vie. They'll wait for him outside the dead end. */
* end. */
if (game.loc == LOC_NOWHERE || if (game.loc == LOC_NOWHERE ||
FORCED(game.loc) || FORCED(game.loc) ||
CNDBIT(game.newloc, COND_NOARRR)) CNDBIT(game.newloc, COND_NOARRR))
@ -343,7 +342,7 @@ static bool dwarfmove(void)
} }
/* When we encounter the first dwarf, we kill 0, 1, or 2 of /* When we encounter the first dwarf, we kill 0, 1, or 2 of
* the 5 dwarves. If any of the survivors is at loc, * the 5 dwarves. If any of the survivors is at game.loc,
* replace him with the alternate. */ * replace him with the alternate. */
if (game.dflag == 1) { if (game.dflag == 1) {
if (!INDEEP(game.loc) || if (!INDEEP(game.loc) ||
@ -644,7 +643,6 @@ static void playermove( int motion)
/* (ESR) We've found a destination that goes with the motion verb. /* (ESR) We've found a destination that goes with the motion verb.
* Next we need to check any conditional(s) on this destination, and * Next we need to check any conditional(s) on this destination, and
* possibly on following entries. */ * possibly on following entries. */
/* FIXME: Magic numbers related to move opcodes */
do { do {
for (;;) { /* L12 loop */ for (;;) { /* L12 loop */
for (;;) { for (;;) {