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

Function mkmonmoney

src/makemon.c:575–586  ·  view source on GitHub ↗

create a new stack of gold in monster's inventory */

Source from the content-addressed store, hash-verified

573
574/* create a new stack of gold in monster's inventory */
575void
576mkmonmoney(struct monst *mtmp, long amount)
577{
578 /* mk_mplayer() passes rn2(1000) so the amount might be 0 */
579 if (amount > 0L) {
580 struct obj *gold = mksobj(GOLD_PIECE, FALSE, FALSE);
581
582 gold->quan = amount;
583 gold->owt = weight(gold);
584 add_to_minv(mtmp, gold);
585 }
586}
587
588staticfn void
589m_initinv(struct monst *mtmp)

Callers 3

mk_mplayerFunction · 0.85
shkinitFunction · 0.85
m_initinvFunction · 0.85

Calls 3

mksobjFunction · 0.85
weightFunction · 0.85
add_to_minvFunction · 0.85

Tested by

no test coverage detected