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

Function ballrelease

src/ball.c:22–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#endif
21
22void
23ballrelease(boolean showmsg)
24{
25 if (carried(uball) && !welded(uball)) {
26 if (showmsg)
27 pline("Startled, you drop the iron ball.");
28 if (uwep == uball)
29 setuwep((struct obj *) 0);
30 if (uswapwep == uball)
31 setuswapwep((struct obj *) 0);
32 if (uquiver == uball)
33 setuqwep((struct obj *) 0);
34 /* [this used to test 'if (uwep != uball)' but that always passes
35 after the setuwep() above] */
36 freeinv(uball); /* remove from inventory but don't place on floor */
37 encumber_msg();
38 }
39}
40
41/* ball&chain might hit hero when falling through a trap door */
42void

Callers 3

ballfallFunction · 0.85
goto_levelFunction · 0.85
makemap_prepostFunction · 0.85

Calls 7

weldedFunction · 0.85
setuwepFunction · 0.85
setuswapwepFunction · 0.85
setuqwepFunction · 0.85
freeinvFunction · 0.85
encumber_msgFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected