From c844142966d9b7a10a82bdebfbe4a9f30b520de6 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sat, 4 Aug 2007 14:25:46 +0200 Subject: [PATCH] Fix Shogi::Piece::OppositeColor. The opposite of INVALID_COLOR is not WHITE. --- src/hlvariant/shogi/piece.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hlvariant/shogi/piece.cpp b/src/hlvariant/shogi/piece.cpp index f64955d..5b93cfc 100644 --- a/src/hlvariant/shogi/piece.cpp +++ b/src/hlvariant/shogi/piece.cpp @@ -78,7 +78,8 @@ QString Piece::name() const { } Piece::Color Piece::oppositeColor(Color color) { - return color == WHITE ? BLACK : WHITE; + return (color == WHITE) ? BLACK : + (color == BLACK) ? WHITE : INVALID_COLOR; } bool Piece::operator==(const Piece& other) const { -- 2.11.4.GIT