stale engraving marker still showing at prompt

This commit is contained in:
nhmall
2026-06-01 20:44:17 -04:00
parent a31a9cb152
commit 29c300b4e0
2 changed files with 21 additions and 3 deletions
+4 -1
View File
@@ -50,7 +50,10 @@ avoid calling costly_spot(), costly_adjacent(), find_byowner(), which
all rely on shop_keeper() under the hood, in the midst of the level all rely on shop_keeper() under the hood, in the midst of the level
loading process before all the required data structures have loading process before all the required data structures have
been finalized been finalized
if the hero has already been told that an engraving vanished, ensure that
the engraving marker isn't still showing when prompted for a
new engraving
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
----------------------------------------- -----------------------------------------
+17 -2
View File
@@ -18,6 +18,7 @@ struct _doengrave_ctx {
boolean disprefresh; /* TRUE if the display needs a refresh */ boolean disprefresh; /* TRUE if the display needs a refresh */
boolean frosted; /* TRUE if engraving on ice */ boolean frosted; /* TRUE if engraving on ice */
boolean adding; /* TRUE if adding to existing engraving */ boolean adding; /* TRUE if adding to existing engraving */
boolean hero_told_it_vanished;
int ret; /* doengrave return value */ int ret; /* doengrave return value */
int type; /* Type of engraving made */ int type; /* Type of engraving made */
@@ -553,6 +554,7 @@ doengrave_ctx_init(struct _doengrave_ctx *de)
de->zapwand = FALSE; de->zapwand = FALSE;
de->disprefresh = FALSE; de->disprefresh = FALSE;
de->adding = FALSE; de->adding = FALSE;
de->hero_told_it_vanished = FALSE;
de->ret = ECMD_OK; de->ret = ECMD_OK;
de->type = DUST; de->type = DUST;
@@ -666,17 +668,21 @@ doengrave_sfx_item_WAN(struct _doengrave_ctx *de)
case WAN_CANCELLATION: case WAN_CANCELLATION:
case WAN_MAKE_INVISIBLE: case WAN_MAKE_INVISIBLE:
if (de->oep && de->oep->engr_type != HEADSTONE) { if (de->oep && de->oep->engr_type != HEADSTONE) {
if (!Blind) if (!Blind) {
pline_The("engraving on the %s vanishes!", pline_The("engraving on the %s vanishes!",
surface(u.ux, u.uy)); surface(u.ux, u.uy));
de->hero_told_it_vanished = TRUE;
}
de->dengr = TRUE; de->dengr = TRUE;
} }
break; break;
case WAN_TELEPORTATION: case WAN_TELEPORTATION:
if (de->oep && de->oep->engr_type != HEADSTONE) { if (de->oep && de->oep->engr_type != HEADSTONE) {
if (!Blind) if (!Blind) {
pline_The("engraving on the %s vanishes!", pline_The("engraving on the %s vanishes!",
surface(u.ux, u.uy)); surface(u.ux, u.uy));
de->hero_told_it_vanished = TRUE;
}
de->teleengr = TRUE; de->teleengr = TRUE;
} }
break; break;
@@ -1171,6 +1177,15 @@ doengrave(void)
de->adding = (de->oep && !de->eow); de->adding = (de->oep && !de->eow);
doengrave_ctx_verb(de); doengrave_ctx_verb(de);
/* The old engraving indictor is probably still showing
* if, for example, the hero is invisible. Get rid of it
* right now, if the player has already been told that
* it vanished, before proceeding with a new engraving.
*/
if (de->hero_told_it_vanished)
newsym(u.ux, u.uy);
/* Tell adventurer what is going on */ /* Tell adventurer what is going on */
if (de->otmp != &hands_obj) if (de->otmp != &hands_obj)
You("%s the %s with %s%s.", de->everb, de->eloc, You("%s the %s with %s%s.", de->everb, de->eloc,