[iagno] computer-player: crash on invalid moves



commit 39b74f9da6f253eb2c9182f5b5aea88ca371eb7f
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Fri Sep 19 09:06:50 2014 -0500

    computer-player: crash on invalid moves
    
    Fortunately, this doesn't happen anymore. Let's make sure it stays that
    way.

 src/computer-player.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/computer-player.vala b/src/computer-player.vala
index 3f28888..ea80e7e 100644
--- a/src/computer-player.vala
+++ b/src/computer-player.vala
@@ -67,7 +67,10 @@ public class ComputerPlayer : Object
     private void complete_move (int x, int y)
     {
         if (game.place_tile (x, y) == 0)
+        {
             critical ("Computer chose an invalid move: %d,%d", x, y);
+            assert_not_reached ();
+        }
     }
 
     public void move ()


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