* Stop a burn timeout on the given object if timer attached. Darken * light source. */
| 1801 | * light source. |
| 1802 | */ |
| 1803 | void |
| 1804 | end_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. |
no test coverage detected