Bah; r4954 introduced an array overrun.
[sgt/puzzles] / net.c
diff --git a/net.c b/net.c
index 3c3f971..bb9218f 100644 (file)
--- a/net.c
+++ b/net.c
@@ -13,6 +13,7 @@
 #include "tree234.h"
 
 const char *const game_name = "Net";
+const char *const game_winhelp_topic = "games.net";
 const int game_can_configure = TRUE;
 
 #define PI 3.141592653589793238462643383279502884197169399
@@ -840,6 +841,7 @@ game_state *make_move(game_state *state, game_ui *ui, int x, int y, int button)
            button = MIDDLE_BUTTON;
        else if (button == 'd' || button == 'D')
            button = RIGHT_BUTTON;
+        ui->cur_visible = TRUE;
     } else
        return nullret;
 
@@ -1249,7 +1251,7 @@ static void draw_tile(frontend *fe, game_state *state, int x, int y, int tile,
 }
 
 void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
-                 game_state *state, game_ui *ui, float t, float ft)
+                 game_state *state, int dir, game_ui *ui, float t, float ft)
 {
     int x, y, tx, ty, frame;
     unsigned char *active;
@@ -1321,11 +1323,9 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
         break_label:
 
         if (tx >= 0) {
-            if (tile(state, tx, ty) == ROT(tile(oldstate, tx, ty),
-                                           state->last_rotate_dir))
-                angle = state->last_rotate_dir * 90.0F * (t / ROTATE_TIME);
-            else
-                angle = state->last_rotate_dir * -90.0F * (t / ROTATE_TIME);
+            int last_rotate_dir = dir==-1 ? oldstate->last_rotate_dir :
+                                            state->last_rotate_dir;
+            angle = last_rotate_dir * dir * 90.0F * (t / ROTATE_TIME);
             state = oldstate;
         }
     }
@@ -1402,7 +1402,7 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
     sfree(active);
 }
 
-float game_anim_length(game_state *oldstate, game_state *newstate)
+float game_anim_length(game_state *oldstate, game_state *newstate, int dir)
 {
     int x, y;
 
@@ -1419,7 +1419,7 @@ float game_anim_length(game_state *oldstate, game_state *newstate)
     return 0.0F;
 }
 
-float game_flash_length(game_state *oldstate, game_state *newstate)
+float game_flash_length(game_state *oldstate, game_state *newstate, int dir)
 {
     /*
      * If the game has just been completed, we display a completion