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

Function unplacebc_core

src/ball.c:146–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146staticfn void
147unplacebc_core(void)
148{
149 if (u.uswallow) {
150 if (Is_waterlevel(&u.uz)) {
151 /* we need to proceed with the removal from the floor
152 * so that movebubbles() processing will disregard it as
153 * intended. Ignore all the vision stuff.
154 */
155 if (!carried(uball))
156 obj_extract_self(uball);
157 obj_extract_self(uchain);
158 }
159 /* ball&chain not unplaced while swallowed */
160 return;
161 }
162
163 if (!carried(uball)) {
164 obj_extract_self(uball);
165 if (Blind && (u.bc_felt & BC_BALL)) /* drop glyph */
166 levl[uball->ox][uball->oy].glyph = u.bglyph;
167 maybe_unhide_at(uball->ox, uball->oy);
168 newsym(uball->ox, uball->oy);
169 }
170 obj_extract_self(uchain);
171 if (Blind && (u.bc_felt & BC_CHAIN)) /* drop glyph */
172 levl[uchain->ox][uchain->oy].glyph = u.cglyph;
173 maybe_unhide_at(uchain->ox, uchain->oy);
174
175 newsym(uchain->ox, uchain->oy);
176 u.bc_felt = 0; /* feel nothing */
177}
178
179staticfn boolean
180check_restriction(int restriction)

Callers 4

unplacebcFunction · 0.85
UnplacebcFunction · 0.85

Calls 3

obj_extract_selfFunction · 0.85
maybe_unhide_atFunction · 0.85
newsymFunction · 0.85

Tested by

no test coverage detected