X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=069c8651c808ea312a150a4b9246713226a7a52a;hb=e9e747cffb273e85f4a42465813e1dca2b220e51;hp=6fa2ddcbc7c954f53fd111b5ce4bfbd386208586;hpb=985137d9c7ed18ee0777622874efe944218cae6a;p=open-adventure.git 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);