From 237927e3e5054293009c4a7b0f0731e3d08af91b Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Mon, 6 Nov 2017 00:33:56 +0100 Subject: [PATCH] Mark "fortmagma" as locked until the door can open (#3015) Keep the "fortmagma" challenge marked as locked on the GUI minimap even if enough points (180+) have been gathered to unlocked it, when the door is not open yet --- src/states_screens/race_gui_overworld.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/states_screens/race_gui_overworld.cpp b/src/states_screens/race_gui_overworld.cpp index 7a168e43e..a2ed59c1f 100644 --- a/src/states_screens/race_gui_overworld.cpp +++ b/src/states_screens/race_gui_overworld.cpp @@ -443,6 +443,19 @@ void RaceGUIOverworld::drawGlobalMiniMap() const ChallengeData* challenge = unlock_manager->getChallengeData(challenges[n].m_challenge_id); const unsigned int val = challenge->getNumTrophies(); bool unlocked = (PlayerManager::getCurrentPlayer()->getPoints() >= val); + if (challenges[n].m_challenge_id == "fortmagma") + { + // For each track, check whether any difficulty has been completed ; fortmagma will not affect our decision (`n == m`) ; tutorial is ignored because it has no completion level + for (unsigned int m = 0; unlocked && m < challenges.size(); m++) + { + if (challenges[m].m_challenge_id == "tutorial") continue; + unlocked = unlocked && + (PlayerManager::getCurrentPlayer() + ->getChallengeStatus(challenges[m].m_challenge_id) + ->isSolvedAtAnyDifficulty() || n == m); + } + } + int state = (unlocked ? OPEN : LOCKED); if (UserConfigParams::m_everything_unlocked)