call in drop, throw, and put in box, etc. */
| 1469 | |
| 1470 | /* call in drop, throw, and put in box, etc. */ |
| 1471 | boolean |
| 1472 | snuff_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 |
no test coverage detected