[iagno] Don't flip the board if a player has no tiles



commit c55615f231048fab4ca8a3ab88529c1f4f778c58
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Sep 7 23:25:38 2013 -0500

    Don't flip the board if a player has no tiles
    
    At the end of the game, we "flip" the board (not actually a flip) to
    visually show which player has the most pieces.  This looks confusing if
    one player lost by losing all his pieces, and is definitely not needed
    to clarify who won, so let's skip this in that case.

 src/game-view.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index 63bf0e7..553e7fd 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -217,7 +217,7 @@ public class GameView : Gtk.DrawingArea
         var pixmap = get_pixmap (game.get_owner (x, y));
 
         /* If requested show the result by laying the tiles with winning color first */
-        if (game.is_complete && flip_final_result)
+        if (game.is_complete && flip_final_result && game.n_light_tiles > 0 && game.n_dark_tiles > 0)
         {
             var n = y * game.width + x;
             var winning_color = Player.LIGHT;


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