diff --git a/src/engine/local_engine/engine_msg.h b/src/engine/local_engine/engine_msg.h index 955f10b9..9d8fc244 100644 --- a/src/engine/local_engine/engine_msg.h +++ b/src/engine/local_engine/engine_msg.h @@ -24,6 +24,8 @@ #define ERR_SEAT_NOT_FOUND 10001 #define ERR_ACTIVE_PLAYER_NOT_FOUND 10002 #define ERR_RUNNING_PLAYER_NOT_FOUND 10003 +#define ERR_DEALER_NOT_FOUND 10004 +#define ERR_CURRENT_PLAYER_NOT_FOUND 10005 #define ERR_NEXT_DEALER_NOT_FOUND 10010 #define ERR_NEXT_ACTIVE_PLAYER_NOT_FOUND 10011 diff --git a/src/game.cpp b/src/game.cpp index 62afcde6..955bbcc0 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -66,7 +66,8 @@ Game::Game(GuiInterface* gui, boost::shared_ptr factory, break; ++player_i; } - assert(player_i != player_end); + if (player_i == player_end) + throw LocalException(ERR_DEALER_NOT_FOUND); dealerPosition = startData.startDealerPlayerId; // Board erstellen @@ -228,8 +229,6 @@ void Game::initHand() void Game::startHand() { - assert(actualHand); - //GUI bereinigen myGui->nextRoundCleanGui(); @@ -260,7 +259,8 @@ boost::shared_ptr Game::getPlayerByUniqueId(unsigned id) boost::shared_ptr Game::getCurrentPlayer() { boost::shared_ptr tmpPlayer = getPlayerByUniqueId(getCurrentHand()->getCurrentBeRo()->getCurrentPlayersTurnId()); - assert(tmpPlayer.get()); + if (!tmpPlayer.get()) + throw LocalException(ERR_CURRENT_PLAYER_NOT_FOUND); return tmpPlayer; }