diff options
author | Treeki <treeki@gmail.com> | 2013-03-03 02:54:37 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-03-03 02:54:37 +0100 |
commit | 2ba72be9e2973ebd68543087a473aa3f10bdb9bb (patch) | |
tree | 8ec02c9786cf29ea2f2d3ba99acbaac9201ae106 /src | |
parent | dbae0046b314e5644aa8b586b7b20fb7afd25be3 (diff) | |
download | kamek-2ba72be9e2973ebd68543087a473aa3f10bdb9bb.tar.gz kamek-2ba72be9e2973ebd68543087a473aa3f10bdb9bb.zip |
fix a couple of bugs with the path unlocking and congratulations messages
Diffstat (limited to 'src')
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 105 |
1 files changed, 54 insertions, 51 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 48590f9..d55ad12 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -174,66 +174,68 @@ void dWMPathManager_c::setup() { } // have we got any completions? - u32 conds = save->GetLevelCondition(LastLevelPlayed[0], LastLevelPlayed[1]); - dLevelInfo_c::entry_s *whatEntry = - dLevelInfo_c::s_info.searchBySlot(LastLevelPlayed[0], LastLevelPlayed[1]); - - // how many exits? - int exits = 0, maxExits = 0; - if (whatEntry->flags & 0x10) { - maxExits++; - if (conds & COND_NORMAL) - exits++; - } - if (whatEntry->flags & 0x20) { - maxExits++; - if (conds & COND_SECRET) - exits++; - } + if (LastLevelPlayed[0] != 0xFF) { + u32 conds = save->GetLevelCondition(LastLevelPlayed[0], LastLevelPlayed[1]); + dLevelInfo_c::entry_s *whatEntry = + dLevelInfo_c::s_info.searchBySlot(LastLevelPlayed[0], LastLevelPlayed[1]); + + // how many exits? + int exits = 0, maxExits = 0; + if (whatEntry->flags & 0x10) { + maxExits++; + if (conds & COND_NORMAL) + exits++; + } + if (whatEntry->flags & 0x20) { + maxExits++; + if (conds & COND_SECRET) + exits++; + } - completionMessageWorldNum = whatEntry->displayWorld; + completionMessageWorldNum = whatEntry->displayWorld; - // now do all the message checks - int flag = 0, totalFlag = 0; - if (CanFinishCoins) { - totalFlag |= 1; - if ((conds & COND_COIN_ALL) == COND_COIN_ALL) { - flag |= 1; - completionMessageType = CMP_MSG_COINS; + // now do all the message checks + int flag = 0, totalFlag = 0; + if (CanFinishCoins) { + totalFlag |= 1; + if ((conds & COND_COIN_ALL) == COND_COIN_ALL) { + flag |= 1; + completionMessageType = CMP_MSG_COINS; + } } - } - if (CanFinishExits) { - totalFlag |= 2; - if (exits == maxExits) { - flag |= 2; - completionMessageType = CMP_MSG_EXITS; + if (CanFinishExits) { + totalFlag |= 2; + if (exits == maxExits) { + flag |= 2; + completionMessageType = CMP_MSG_EXITS; + } } - } - if (CanFinishWorld && flag == totalFlag) - completionMessageType = CMP_MSG_WORLD; + if (CanFinishWorld && flag == totalFlag) + completionMessageType = CMP_MSG_WORLD; - if (CanFinishAlmostAllCoins) { - if ((conds & COND_COIN_ALL) == COND_COIN_ALL) - completionMessageType = CMP_MSG_GLOBAL_COINS_EXC_W9; - } + if (CanFinishAlmostAllCoins) { + if ((conds & COND_COIN_ALL) == COND_COIN_ALL) + completionMessageType = CMP_MSG_GLOBAL_COINS_EXC_W9; + } - int gFlag = 0, gTotalFlag = 0; - if (CanFinishAllCoins) { - gTotalFlag |= 1; - if ((conds & COND_COIN_ALL) == COND_COIN_ALL) { - gFlag |= 1; - completionMessageType = CMP_MSG_GLOBAL_COINS; + int gFlag = 0, gTotalFlag = 0; + if (CanFinishAllCoins) { + gTotalFlag |= 1; + if ((conds & COND_COIN_ALL) == COND_COIN_ALL) { + gFlag |= 1; + completionMessageType = CMP_MSG_GLOBAL_COINS; + } } - } - if (CanFinishAllExits) { - gTotalFlag |= 2; - if (exits == maxExits) { - gFlag |= 2; - completionMessageType = CMP_MSG_GLOBAL_EXITS; + if (CanFinishAllExits) { + gTotalFlag |= 2; + if (exits == maxExits) { + gFlag |= 2; + completionMessageType = CMP_MSG_GLOBAL_EXITS; + } } + if (CanFinishEverything && gFlag == gTotalFlag) + completionMessageType = CMP_MSG_EVERYTHING; } - if (CanFinishEverything && gFlag == gTotalFlag) - completionMessageType = CMP_MSG_EVERYTHING; ResetAllCompletionCandidates(); @@ -738,6 +740,7 @@ void dWMPathManager_c::execute() { STD_ZOOM); panningCameraFromPaths = true; } + return; } if (panningCameraFromPaths) { |