mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-11-16 07:47:39 +01:00
GameSignals: update member variables correctly when the game is destroyed
This commit is contained in:
parent
b7825e1998
commit
02f284f3ae
1 changed files with 9 additions and 4 deletions
|
@ -40,17 +40,22 @@ void GameSignals::notifyGameChanged(PublicGame *iGame)
|
|||
m_game = iGame;
|
||||
emit gameChangedNonConst(iGame);
|
||||
emit gameChanged(iGame);
|
||||
if (iGame != NULL)
|
||||
notifyGameUpdated();
|
||||
}
|
||||
|
||||
|
||||
void GameSignals::notifyGameUpdated()
|
||||
{
|
||||
emit gameUpdated();
|
||||
|
||||
if (m_game == NULL)
|
||||
{
|
||||
m_currentTurn = 0;
|
||||
m_lastTurn = 0;
|
||||
m_lastGameRack = PlayedRack();
|
||||
m_lastCurrPlayerRack = PlayedRack();
|
||||
return;
|
||||
}
|
||||
|
||||
emit gameUpdated();
|
||||
|
||||
unsigned currTurn = m_game->getCurrTurn();
|
||||
bool isLastTurn = m_game->isLastTurn();
|
||||
|
|
Loading…
Reference in a new issue