MCPcopy Index your code
hub / github.com/NetHack/NetHack / take_gold

Function take_gold

src/sit.c:13–33  ·  view source on GitHub ↗

take away the hero's money */

Source from the content-addressed store, hash-verified

11
12/* take away the hero's money */
13void
14take_gold(void)
15{
16 struct obj *otmp, *nobj;
17 int lost_money = 0;
18
19 for (otmp = gi.invent; otmp; otmp = nobj) {
20 nobj = otmp->nobj;
21 if (otmp->oclass == COIN_CLASS) {
22 lost_money = 1;
23 remove_worn_item(otmp, FALSE);
24 delobj(otmp);
25 }
26 }
27 if (!lost_money) {
28 You_feel("a strange sensation.");
29 } else {
30 You("notice you have no gold!");
31 disp.botl = TRUE;
32 }
33}
34
35staticfn void special_throne_effect(int effect);
36

Callers 2

throne_sit_effectFunction · 0.85
cursed_bookFunction · 0.85

Calls 4

remove_worn_itemFunction · 0.85
delobjFunction · 0.85
You_feelFunction · 0.85
YouFunction · 0.85

Tested by

no test coverage detected