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

Function dopickup

src/hack.c:3875–3892  ·  view source on GitHub ↗

the #pickup command */

Source from the content-addressed store, hash-verified

3873
3874/* the #pickup command */
3875int
3876dopickup(void)
3877{
3878 int count, tmpcount, ret;
3879
3880 count = (int) gc.command_count;
3881 gm.multi = 0; /* always reset */
3882
3883 if ((ret = pickup_checks()) >= 0) {
3884 return ret ? ECMD_TIME : ECMD_OK;
3885 } else if (ret == -2) {
3886 tmpcount = -count;
3887 return loot_mon(u.ustuck, &tmpcount, (boolean *) 0) ? ECMD_TIME
3888 : ECMD_OK;
3889 } /* else ret == -1 */
3890
3891 return pickup(-count) ? ECMD_TIME : ECMD_OK;
3892}
3893
3894/* stop running if we see something interesting next to us */
3895/* turn around a corner if that is the only way we can proceed */

Callers

nothing calls this directly

Calls 3

pickup_checksFunction · 0.85
loot_monFunction · 0.85
pickupFunction · 0.85

Tested by

no test coverage detected