From: Pasi Kallinen Date: Sat, 14 Mar 2020 09:28:29 +0000 (+0200) Subject: Flip timed effects X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55bfc8115a311dd080d5648743070885562a362a;p=nethack Flip timed effects In wizard mode, freezing some water on the ground, then flipping the level did not flip the coordinate of the ice thawing timed effect. This could cause an impossible complaint. --- diff --git a/src/sp_lev.c b/src/sp_lev.c index 6cbd35be1..9f0d3b943 100755 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -447,6 +447,7 @@ boolean extras; struct monst *mtmp; struct engr *etmp; struct mkroom *sroom; + timer_element *timer; get_level_extends(&minx, &miny, &maxx, &maxy); /* get_level_extends() returns -1,-1 to COLNO,ROWNO at max */ @@ -712,6 +713,19 @@ boolean extras; } } + /* timed effects */ + for (timer = g.timer_base; timer; timer = timer->next) { + if (timer->func_index == MELT_ICE_AWAY) { + long ty = ((long)timer->arg.a_void) & 0xFFFF; + long tx = (((long)timer->arg.a_void) >> 16) & 0xFFFF; + if (flp & 1) + ty = FlipY(ty); + if (flp & 2) + tx = FlipX(tx); + timer->arg.a_void = (genericptr_t)((tx << 16) | ty); + } + } + if (extras) { /* flip hero location only if inside the flippable area */ if (!(u.ux < minx || u.ux > maxx || u.uy < miny || u.uy > maxy)) {