* Find the first (and hopefully only) gold object in a chain. * Used when leprechaun (or you as leprechaun) looks for * someone else's gold. Returns a pointer so the gold may * be seized without further searching. * May search containers too. * Deals in gold only, as leprechauns don't care for lesser coins. */
| 42 | * Deals in gold only, as leprechauns don't care for lesser coins. |
| 43 | */ |
| 44 | struct obj * |
| 45 | findgold(struct obj *argchain) |
| 46 | { |
| 47 | struct obj *chain = argchain; /* allow arg to be nonnull */ |
| 48 | |
| 49 | while (chain && chain->otyp != GOLD_PIECE) |
| 50 | chain = chain->nobj; |
| 51 | return chain; |
| 52 | } |
| 53 | |
| 54 | /* |
| 55 | * Steal gold coins only. Leprechauns don't care for lesser coins. |
no outgoing calls
no test coverage detected