From 7f3f29df319914d0c0e78646e1b719e677e6dbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Wed, 16 Jan 2013 14:31:44 +0100 Subject: [PATCH] HistoryWidget: compute the player ID instead of getting it from TurnData --- qt/history_widget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt/history_widget.cpp b/qt/history_widget.cpp index 96fd880..088ff53 100644 --- a/qt/history_widget.cpp +++ b/qt/history_widget.cpp @@ -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)); }