]> granicus.if.org Git - nethack/commitdiff
clipping patch (from <Someone>)
authornethack.allison <nethack.allison>
Thu, 14 Aug 2003 11:17:49 +0000 (11:17 +0000)
committernethack.allison <nethack.allison>
Thu, 14 Aug 2003 11:17:49 +0000 (11:17 +0000)
No objections were heard to this previously circulated
change.

> Clipping should occur right before user input (rhack) vs in the
> beginning of the move loop. For example, if hero had
> "teleportitis" and teleported because of that then the clipping
> region was not updated to reflect a new hero position until the
> next turn. This patch fixes that.

src/allmain.c

index af56a83294d4b251214a29298385d00660f1bfae..b54f7cebc5aefc3e2aaf6024cb5fd8f3673e7364 100644 (file)
@@ -60,9 +60,6 @@ moveloop()
     youmonst.movement = NORMAL_SPEED;  /* give the hero some movement points */
 
     for(;;) {
-#ifdef CLIPPING
-       cliparound(u.ux, u.uy);
-#endif
        get_nh_event();
 #ifdef POSITIONBAR
        do_positionbar();
@@ -381,6 +378,11 @@ moveloop()
            sanity_check();
 #endif
 
+#ifdef CLIPPING
+       /* just before rhack */
+       cliparound(u.ux, u.uy);
+#endif
+
        u.umoved = FALSE;
 
        if (multi > 0) {