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

Function trap_ice_effects

src/trap.c:7174–7194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7172}
7173
7174void
7175trap_ice_effects(coordxy x, coordxy y, boolean ice_is_melting)
7176{
7177 struct trap *ttmp = t_at(x, y);
7178
7179 if (ttmp && ice_is_melting) {
7180 struct monst *mtmp;
7181
7182 if (((mtmp = m_at(x, y)) != 0) && mtmp->mtrapped)
7183 mtmp->mtrapped = 0;
7184 if (ttmp->ttyp == LANDMINE || ttmp->ttyp == BEAR_TRAP) {
7185 /* landmine or bear trap set on top of the ice falls
7186 into the water */
7187 int otyp = (ttmp->ttyp == LANDMINE) ? LAND_MINE : BEARTRAP;
7188 cnv_trap_obj(otyp, 1, ttmp, TRUE);
7189 } else {
7190 if (!undestroyable_trap(ttmp->ttyp))
7191 deltrap(ttmp);
7192 }
7193 }
7194}
7195
7196/* sanity check traps */
7197void

Callers 1

melt_iceFunction · 0.85

Calls 3

t_atFunction · 0.85
cnv_trap_objFunction · 0.85
deltrapFunction · 0.85

Tested by

no test coverage detected