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

Function bc_order

src/ball.c:353–371  ·  view source on GitHub ↗

* Return the stacking of the hero's ball & chain. This assumes that the * hero is being punished. */

Source from the content-addressed store, hash-verified

351 * hero is being punished.
352 */
353staticfn int
354bc_order(void)
355{
356 struct obj *obj;
357
358 if (uchain->ox != uball->ox || uchain->oy != uball->oy || carried(uball)
359 || u.uswallow)
360 return BCPOS_DIFFER;
361
362 for (obj = svl.level.objects[uball->ox][uball->oy]; obj;
363 obj = obj->nexthere) {
364 if (obj == uchain)
365 return BCPOS_CHAIN;
366 if (obj == uball)
367 return BCPOS_BALL;
368 }
369 impossible("bc_order: ball&chain not in same location!");
370 return BCPOS_DIFFER;
371}
372
373/*
374 * set_bc()

Callers 3

set_bcFunction · 0.85
move_bcFunction · 0.85
drop_ballFunction · 0.85

Calls 1

impossibleFunction · 0.70

Tested by

no test coverage detected