MCPcopy Create free account
hub / github.com/NetHack/NetHack / findgold

Function findgold

src/steal.c:44–52  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

42 * Deals in gold only, as leprechauns don't care for lesser coins.
43*/
44struct obj *
45findgold(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.

Callers 12

stealgoldFunction · 0.85
relobjFunction · 0.85
gold_detectFunction · 0.85
object_detectFunction · 0.85
steal_itFunction · 0.85
mhitm_ad_sgldFunction · 0.85
m_initinvFunction · 0.85
dochugFunction · 0.85
leppie_avoidanceFunction · 0.85
leppie_stashFunction · 0.85
money2monFunction · 0.85
money2uFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected