X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=main.c;h=069c8651c808ea312a150a4b9246713226a7a52a;hp=6fa2ddcbc7c954f53fd111b5ce4bfbd386208586;hb=c3a2816821512b59a09866a594a9bec699193271;hpb=25077d0b4eb1d6a85140c01092be7203ca64a49c diff --git a/main.c b/main.c index 6fa2ddc..069c865 100644 --- a/main.c +++ b/main.c @@ -289,7 +289,9 @@ static bool spotted_by_pirate(int i) return true; int snarfed = 0; bool movechest = false, robplayer = false; - for (int treasure = MINTRS; treasure <= MAXTRS; treasure++) { + for (int treasure = 1; treasure <= NOBJECTS; treasure++) { + if (!object_descriptions[treasure].is_treasure) + continue; /* Pirate won't take pyramid from plover room or dark * room (too easy!). */ if (treasure == PYRAMID && (game.loc == PLAC[PYRAMID] || game.loc == PLAC[EMERALD])) { @@ -323,7 +325,9 @@ static bool spotted_by_pirate(int i) } if (robplayer) { rspeak(PIRATE_POUNCES); - for (int treasure = MINTRS; treasure <= MAXTRS; treasure++) { + for (int treasure = 1; treasure <= NOBJECTS; treasure++) { + if (!object_descriptions[treasure].is_treasure) + continue; if (!(treasure == PYRAMID && (game.loc == PLAC[PYRAMID] || game.loc == PLAC[EMERALD]))) { if (AT(treasure) && game.fixed[treasure] == 0) CARRY(treasure, game.loc);