From 2f7c09ec8326d5f135928efd9c5611c9aefe9ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Wed, 4 Apr 2012 21:04:21 +0200 Subject: [PATCH] Arbitration: do not consider the "No move" move as a real move assignment --- qt/arbit_assignments.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qt/arbit_assignments.cpp b/qt/arbit_assignments.cpp index 87dd0fa..a12d2c3 100644 --- a/qt/arbit_assignments.cpp +++ b/qt/arbit_assignments.cpp @@ -150,11 +150,16 @@ void ArbitAssignments::updatePlayersModel() for (unsigned int i = 0; i < m_game->getNbPlayers(); ++i) { const Player &player = m_game->getPlayer(i); - if (hideAssignedPlayers && m_game->hasPlayed(player.getId())) - continue; // Only display human players if (!player.isHuman()) continue; + // Hide players with an assigned move other than "No move" + if (hideAssignedPlayers && m_game->hasPlayed(player.getId()) && + player.getLastMove().getType() != Move::NO_MOVE) + { + continue; + } + const int rowNum = m_playersModel->rowCount(); m_playersModel->insertRow(rowNum); m_playersModel->setData(m_playersModel->index(rowNum, 0), player.getTableNb()); @@ -273,7 +278,6 @@ void ArbitAssignments::populatePlayersMenu(QMenu &iMenu, const QPoint &iPoint) void ArbitAssignments::on_checkBoxHideAssigned_toggled(bool) { - treeViewPlayers->selectionModel()->clearSelection(); updatePlayersModel(); } @@ -486,8 +490,11 @@ void ArbitAssignments::helperAssignMove(const Move &iMove) QSet assignedIdSet; BOOST_FOREACH(unsigned int id, playersIdSet) { - if (m_game->hasPlayed(id)) + if (m_game->hasPlayed(id) && + m_game->getPlayer(id).getLastMove().getType() != Move::NO_MOVE) + { assignedIdSet.insert(id); + } } if (!assignedIdSet.empty()) {