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

Function mpickgold

src/mon.c:1826–1843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1824}
1825
1826void
1827mpickgold(struct monst *mtmp)
1828{
1829 struct obj *gold;
1830 int mat_idx;
1831
1832 if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) {
1833 mat_idx = objects[gold->otyp].oc_material;
1834 obj_extract_self(gold);
1835 add_to_minv(mtmp, gold);
1836 if (cansee(mtmp->mx, mtmp->my)) {
1837 if (flags.verbose && !mtmp->isgd)
1838 pline_mon(mtmp, "%s picks up some %s.", Monnam(mtmp),
1839 mat_idx == GOLD ? "gold" : "money");
1840 newsym(mtmp->mx, mtmp->my);
1841 }
1842 }
1843}
1844
1845/* monster picks up one item stack from the map location they are at */
1846boolean

Callers 2

gd_pick_corridor_goldFunction · 0.85
gd_moveFunction · 0.85

Calls 6

g_atFunction · 0.85
obj_extract_selfFunction · 0.85
add_to_minvFunction · 0.85
pline_monFunction · 0.85
MonnamFunction · 0.85
newsymFunction · 0.85

Tested by

no test coverage detected