diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 06de24736..c2683835e 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1335,6 +1335,8 @@ riding negates stealth unless the steed is flying previous hero rising as undead in bones retains intrinsics level temperature affects monster generation amulet of unchanging cannot be polymorphed +wishing for a "lit candle" provided one, but the feedback as it was added into + invent was "partly used candle (lit)" because of how 'lit' timer works Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/objnam.c b/src/objnam.c index a7ee15687..683c9963b 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1293,9 +1293,25 @@ doname_base( break; } else if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP || obj->otyp == BRASS_LANTERN || Is_candle(obj)) { - if (Is_candle(obj) - && obj->age < 20L * (long) objects[obj->otyp].oc_cost) - Strcat(prefix, "partly used "); + if (Is_candle(obj)) { + anything timer; + long full_burn_time = 20L * (long) objects[obj->otyp].oc_cost, + turns_left = obj->age; + + if (obj->lamplit) { + timer = cg.zeroany; + timer.a_obj = obj; + /* without this, wishing for "lit candle" yields + "partly used candle (lit)" because the time it can + burn gets adjusted when it becomes lit; matters for + the message as it gets added to invent and also if it + gets snuffed out immediately (where it will end up as + not partly used after all) */ + turns_left += peek_timer(BURN_OBJECT, &timer) - gm.moves; + } + if (turns_left < full_burn_time) + Strcat(prefix, "partly used "); + } if (obj->lamplit) Strcat(bp, " (lit)"); break;