[four-in-a-row] Fix a bad behaviour.



commit f8fb207f9f2730e6955e3323d39b981a2792af0d
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Jan 9 18:34:16 2020 +0100

    Fix a bad behaviour.

 src/four-in-a-row.vala | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/four-in-a-row.vala b/src/four-in-a-row.vala
index e99393e..c3b6d1b 100644
--- a/src/four-in-a-row.vala
+++ b/src/four-in-a-row.vala
@@ -996,14 +996,14 @@ private class FourInARow : Gtk.Application
 
     private inline bool on_key_press (Gdk.EventKey event)
     {
-        if (timeout != 0
-         || (!gameover && !is_player_human ()))
-            return false;
-
         string key = (!) (Gdk.keyval_name (event.keyval) ?? "");
         if (key == "" || key == "Tab" || event.is_modifier == 1)
             return false;
 
+        if (timeout != 0
+         || (!gameover && !is_player_human ()))
+            return true;
+
         if (gameover)
         {
             blink_winner (2);
@@ -1013,14 +1013,14 @@ private class FourInARow : Gtk.Application
         if (key == "Left" || event.keyval == keypress_left)
         {
             if (column == 0)
-                return false;
+                return true;
             column_moveto--;
             move_cursor (column_moveto);
         }
         else if (key == "Right" || event.keyval == keypress_right)
         {
             if (column >= /* BOARD_COLUMNS_MINUS_ONE */ size - 1)
-                return false;
+                return true;
             column_moveto++;
             move_cursor (column_moveto);
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]