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

Function snuff_candle

src/apply.c:1471–1491  ·  view source on GitHub ↗

call in drop, throw, and put in box, etc. */

Source from the content-addressed store, hash-verified

1469
1470/* call in drop, throw, and put in box, etc. */
1471boolean
1472snuff_candle(struct obj *otmp)
1473{
1474 boolean candle = Is_candle(otmp);
1475
1476 if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION)
1477 && otmp->lamplit) {
1478 char buf[BUFSZ];
1479 coordxy x, y;
1480 boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1);
1481
1482 (void) get_obj_location(otmp, &x, &y, 0);
1483 if (otmp->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1484 pline("%s%scandle%s flame%s extinguished.", Shk_Your(buf, otmp),
1485 (candle ? "" : "candelabrum's "), (many ? "s'" : "'s"),
1486 (many ? "s are" : " is"));
1487 end_burn(otmp, TRUE);
1488 return TRUE;
1489 }
1490 return FALSE;
1491}
1492
1493/* called when lit lamp is hit by water or put into a container or
1494 you've been swallowed by a monster; obj might be in transit while

Callers 5

throwit_mon_hitFunction · 0.85
throwitFunction · 0.85
really_kick_objectFunction · 0.85
return_from_mtossFunction · 0.85
snuff_litFunction · 0.85

Calls 4

get_obj_locationFunction · 0.85
Shk_YourFunction · 0.85
end_burnFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected