From: PatR Date: Sun, 24 Apr 2022 21:22:05 +0000 (-0700) Subject: more shop wall repair X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=238fa9f69435c21c96ab3c4a3ba16b9282b2de6f;p=nethack more shop wall repair Commit 593c3532fcecd7cabd164ff49a64d414761ad800 took the 'catchup' argument away from repair_damage() and calculated it in the routine. Commit 699a25c00b2534383b4ee947b74497203b8c539d put the argument back but neglected to remove calculating and assigning it, making the passed value be ignored. Take that away, finishing 699a25c00b. That affected shop repair messages but wasn't enough to prevent a shop wall repair display glitch. This seems to make things work properly but is little iffy. --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 789e17de4..5b31b29d7 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -877,6 +877,9 @@ restoring while attached ball or chain is on floor in a breach of a shop wall might trigger an impossible about being positioned too far from hero don't try to catch up for lost time for shop damage repair in restdamage() called from getlev(); let normal shopkeeper movement take care of it +shop wall repair that was delayed because the hero or a monster was an + obstacle in the gap at repair time might not be displayed as wall + once the obstacle moved and the repair eventually took place putting objects into a container with menustyle=traditional and then taking them back out with #tip would result in complaints about obj bypass bit being set if sanity_check was On diff --git a/src/shk.c b/src/shk.c index 2f80059ce..e72ebe840 100644 --- a/src/shk.c +++ b/src/shk.c @@ -3690,7 +3690,11 @@ litter_getpos(int *k, xchar x, xchar y, struct monst *shkp) } static void -litter_scatter(xchar *litter, int k, xchar x, xchar y, struct monst *shkp) +litter_scatter( + xchar *litter, + int k, + xchar x, xchar y, + struct monst *shkp) { struct obj *otmp; @@ -3778,17 +3782,16 @@ repair_damage( struct obj *otmp; struct trap *ttmp; int k, disposition = 1; - boolean stop_picking = FALSE; + boolean seeit, stop_picking = FALSE; if (!repairable_damage(tmp_dam, shkp)) return 0; - catchup = g.moves > tmp_dam->when + REPAIR_DELAY; x = tmp_dam->place.x; y = tmp_dam->place.y; + seeit = cansee(x, y); ttmp = t_at(x, y); - if (ttmp) { switch (ttmp->ttyp) { case LANDMINE: @@ -3818,7 +3821,7 @@ repair_damage( break; } deltrap(ttmp); - if (cansee(x, y)) + if (seeit) newsym(x, y); if (!catchup) disposition = 3; @@ -3845,11 +3848,18 @@ repair_damage( litter = litter_getpos(&k, x, y, shkp); litter_scatter(litter, k, x, y, shkp); + /* needed if hero has line-of-sight to the former gap from outside + the shop but is farther than one step away; once the light inside + the shop is blocked, the other newsym() below won't redraw the + spot showing its repaired wall */ + if (seeit) + newsym(x, y); + block_point(x, y); + if (catchup) return 1; /* repair occurred while off level so no messages */ - block_point(x, y); - if (cansee(x, y)) { + if (seeit) { if (IS_WALL(tmp_dam->typ)) { /* player sees actual repair process, so KNOWS it's a wall */ levl[x][y].seenv = SVALL;