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

Function unearth_objs

src/dig.c:2085–2112  ·  view source on GitHub ↗

move objects from buriedobjlist to fobj/nexthere lists; if caller converts terrain from ice to something, it should call obj_ice_effects() */

Source from the content-addressed store, hash-verified

2083/* move objects from buriedobjlist to fobj/nexthere lists; if caller
2084 converts terrain from ice to something, it should call obj_ice_effects() */
2085void
2086unearth_objs(int x, int y)
2087{
2088 struct obj *otmp, *otmp2, *bball;
2089 coord cc;
2090
2091 debugpline2("unearth_objs: at <%d,%d>", x, y);
2092 cc.x = x;
2093 cc.y = y;
2094 bball = buried_ball(&cc);
2095 for (otmp = svl.level.buriedobjlist; otmp; otmp = otmp2) {
2096 otmp2 = otmp->nobj;
2097 if (otmp->ox == x && otmp->oy == y) {
2098 if (bball && otmp == bball
2099 && u.utrap && u.utraptype == TT_BURIEDBALL) {
2100 buried_ball_to_punishment();
2101 } else {
2102 obj_extract_self(otmp);
2103 if (otmp->timed)
2104 (void) stop_timer(ROT_ORGANIC, obj_to_any(otmp));
2105 place_object(otmp, x, y);
2106 stackobj(otmp);
2107 }
2108 }
2109 }
2110 del_engr_at(x, y);
2111 newsym(x, y);
2112}
2113
2114/*
2115 * The organic material has rotted away while buried. As an expansion,

Callers 3

liquid_flowFunction · 0.85
maketrapFunction · 0.85
melt_iceFunction · 0.85

Calls 9

buried_ballFunction · 0.85
obj_extract_selfFunction · 0.85
stop_timerFunction · 0.85
obj_to_anyFunction · 0.85
place_objectFunction · 0.85
stackobjFunction · 0.85
del_engr_atFunction · 0.85
newsymFunction · 0.85

Tested by

no test coverage detected