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

Function costly_spot

src/shk.c:5349–5363  ·  view source on GitHub ↗

called in dokick.c when we kick an object that might be in a store */

Source from the content-addressed store, hash-verified

5347
5348/* called in dokick.c when we kick an object that might be in a store */
5349boolean
5350costly_spot(coordxy x, coordxy y)
5351{
5352 struct monst *shkp;
5353 struct eshk *eshkp;
5354
5355 if (!svl.level.flags.has_shop)
5356 return FALSE;
5357 shkp = shop_keeper(*in_rooms(x, y, SHOPBASE));
5358 if (!shkp || !inhishop(shkp))
5359 return FALSE;
5360 eshkp = ESHK(shkp);
5361 return (boolean) (inside_shop(x, y)
5362 && !(x == eshkp->shk.x && y == eshkp->shk.y));
5363}
5364
5365/* called by sanity checking when an unpaid or no_charge item is not at a
5366 costly_spot; it might still be within the boundary of the shop; if so,

Callers 15

mdrop_objFunction · 0.85
rloc_to_coreFunction · 0.85
rlocoFunction · 0.85
dopushFunction · 0.85
moverock_coreFunction · 0.85
bury_objsFunction · 0.85
check_shop_objFunction · 0.85
breakobjFunction · 0.85
breakchestlockFunction · 0.85
count_contentsFunction · 0.85
useupfFunction · 0.85
autopick_testobjFunction · 0.85

Calls 4

shop_keeperFunction · 0.85
in_roomsFunction · 0.85
inhishopFunction · 0.85
inside_shopFunction · 0.85

Tested by

no test coverage detected