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

Function end_burn

src/timeout.c:1803–1822  ·  view source on GitHub ↗

* Stop a burn timeout on the given object if timer attached. Darken * light source. */

Source from the content-addressed store, hash-verified

1801 * light source.
1802 */
1803void
1804end_burn(struct obj *obj, boolean timer_attached)
1805{
1806 if (!obj->lamplit) {
1807 impossible("end_burn: obj %s not lit", xname(obj));
1808 return;
1809 }
1810
1811 if (obj->otyp == MAGIC_LAMP || artifact_light(obj))
1812 timer_attached = FALSE;
1813
1814 if (!timer_attached) {
1815 /* [DS] Cleanup explicitly, since timer cleanup won't happen */
1816 del_light_source(LS_OBJECT, obj_to_any(obj));
1817 obj->lamplit = 0;
1818 if (obj->where == OBJ_INVENT)
1819 update_inventory();
1820 } else if (!stop_timer(BURN_OBJECT, obj_to_any(obj)))
1821 impossible("end_burn: obj %s not timed!", xname(obj));
1822}
1823
1824/*
1825 * Cleanup a burning object if timer stopped.

Callers 15

setuwepFunction · 0.85
uwepgoneFunction · 0.85
resetobjsFunction · 0.85
drop_upon_deathFunction · 0.85
Armor_offFunction · 0.85
Armor_goneFunction · 0.85
disintegrate_armFunction · 0.85
snuff_light_sourceFunction · 0.85
obj_merge_light_sourcesFunction · 0.85
setmnotwieldedFunction · 0.85
burn_objectFunction · 0.85
bury_an_objFunction · 0.85

Calls 7

xnameFunction · 0.85
artifact_lightFunction · 0.85
del_light_sourceFunction · 0.85
obj_to_anyFunction · 0.85
update_inventoryFunction · 0.85
stop_timerFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected