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

Function ok_to_throw

src/dothrow.c:296–313  ·  view source on GitHub ↗

common to dothrow() and dofire() */

Source from the content-addressed store, hash-verified

294
295/* common to dothrow() and dofire() */
296staticfn boolean
297ok_to_throw(int *shotlimit_p) /* (see dothrow()) */
298{
299 *shotlimit_p = LIMIT_TO_RANGE_INT(0, LARGEST_INT, gc.command_count);
300 gm.multi = 0; /* reset; it's been used up */
301
302 if (notake(gy.youmonst.data)) {
303 You("are physically incapable of throwing or shooting anything.");
304 return FALSE;
305 } else if (nohands(gy.youmonst.data)) {
306 You_cant("throw or shoot without hands."); /* not body_part(HAND) */
307 return FALSE;
308 /*[what about !freehand(), aside from cursed missile launcher?]*/
309 }
310 if (check_capacity((char *) 0))
311 return FALSE;
312 return TRUE;
313}
314
315/* getobj callback for object to be thrown */
316staticfn int

Callers 2

dothrowFunction · 0.85
dofireFunction · 0.85

Calls 3

YouFunction · 0.85
You_cantFunction · 0.85
check_capacityFunction · 0.85

Tested by

no test coverage detected