HistoryWidget: compute the player ID instead of getting it from TurnData

This commit is contained in:
Olivier Teulière 2013-01-16 14:31:44 +01:00
parent 27c9b5015a
commit 7f3f29df31

View file

@ -189,7 +189,10 @@ void HistoryWidget::updateModel()
}
if (m_isFreeGame)
{
const wstring &name = m_game->getPlayer(t.getPlayer()).getName();
// In free game mode, the player id can be easily
// computed from the turn number
unsigned playerId = i % m_game->getNbPlayers();
const wstring &name = m_game->getPlayer(playerId).getName();
setCellData(rowNum, m_colPlayer, qfw(name));
}