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

Function snuff_lit

src/apply.c:1496–1514  ·  view source on GitHub ↗

called when lit lamp is hit by water or put into a container or you've been swallowed by a monster; obj might be in transit while being thrown or dropped so don't assume that its location is valid */

Source from the content-addressed store, hash-verified

1494 you've been swallowed by a monster; obj might be in transit while
1495 being thrown or dropped so don't assume that its location is valid */
1496boolean
1497snuff_lit(struct obj *obj)
1498{
1499 coordxy x, y;
1500
1501 if (obj->lamplit) {
1502 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1503 || obj->otyp == BRASS_LANTERN || obj->otyp == POT_OIL) {
1504 (void) get_obj_location(obj, &x, &y, 0);
1505 if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1506 pline("%s %s out!", Yname2(obj), otense(obj, "go"));
1507 end_burn(obj, TRUE);
1508 return TRUE;
1509 }
1510 if (snuff_candle(obj))
1511 return TRUE;
1512 }
1513 return FALSE;
1514}
1515
1516/* called when lit object is hit by water */
1517boolean

Callers 6

gulpumFunction · 0.85
gulpmmFunction · 0.85
in_containerFunction · 0.85
gulpmuFunction · 0.85
splash_litFunction · 0.85
litroomFunction · 0.85

Calls 6

get_obj_locationFunction · 0.85
Yname2Function · 0.85
otenseFunction · 0.85
end_burnFunction · 0.85
snuff_candleFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected