summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-04-30 21:07:29 +0200
committerTreeki <treeki@gmail.com>2013-04-30 21:07:29 +0200
commit1813612ed36ee857ce9a5f324c1a9a748ffa00cd (patch)
treee167e1ee2423adcd52d942e4c511a48dfcaf8b0f /src
parent24b055139705f63edecb3ceec9db3d3031cf01f7 (diff)
downloadkamek-1813612ed36ee857ce9a5f324c1a9a748ffa00cd.tar.gz
kamek-1813612ed36ee857ce9a5f324c1a9a748ffa00cd.zip
fix bugs involving the After Fortress Mode in KP
Diffstat (limited to '')
-rw-r--r--src/koopatlas/hud.cpp4
-rw-r--r--src/koopatlas/pathmanager.cpp14
2 files changed, 12 insertions, 6 deletions
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp
index 22928a5..592d3b2 100644
--- a/src/koopatlas/hud.cpp
+++ b/src/koopatlas/hud.cpp
@@ -397,7 +397,7 @@ void dWMHud_c::enteredNode(dKPNode_s *node) {
if (node == 0)
node = dScKoopatlas_c::instance->pathManager.currentNode;
- if (node->type == dKPNode_s::LEVEL) {
+ if (node->type == dKPNode_s::LEVEL && doneFirstShow) {
willShowHeader = true;
nodeForHeader = node;
}
@@ -422,6 +422,8 @@ void dWMHud_c::hideFooter() {
}
void dWMHud_c::showFooter() {
+ if (!doneFirstShow)
+ return;
willShowFooter = true;
if (isFooterVisible)
playHideAnim(SHOW_FOOTER);
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index 9741c4b..dd08a3a 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -20,7 +20,7 @@ bool CanFinishEverything = false;
void ResetAllCompletionCandidates() {
// This is called by File Select, btw
MaybeFinishingLevel[0] = 0xFF;
- LastLevelPlayed[0] = 0xFF;
+ LastLevelPlayed[0] |= 0x80;
CanFinishCoins = false;
CanFinishExits = false;
CanFinishWorld = false;
@@ -40,6 +40,8 @@ void dWMPathManager_c::setup() {
currentPath = 0;
reverseThroughPath = false;
+ shouldRequestSave = ((wm->settings & 0x80000) != 0);
+
pathLayer = wm->mapData.pathLayer;
SpammyReport("setting up PathManager\n");
@@ -57,7 +59,7 @@ void dWMPathManager_c::setup() {
mustPlayAfterDeathAnim = true;
daWMPlayer_c::instance->visible = false;
LastPowerupStoreType = BEAT_LEVEL;
- } else if (LastPowerupStoreType == BEAT_LEVEL && LastLevelPlayed[0] != 0xFF) {
+ } else if (LastPowerupStoreType == BEAT_LEVEL && LastLevelPlayed[0] < 0x80) {
mustPlayAfterWinAnim = true;
daWMPlayer_c::instance->visible = false;
}
@@ -195,7 +197,7 @@ void dWMPathManager_c::setup() {
}
// have we got any completions?
- if (LastLevelPlayed[0] != 0xFF) {
+ if (LastLevelPlayed[0] < 0x80) {
u32 conds = save->GetLevelCondition(LastLevelPlayed[0], LastLevelPlayed[1]);
dLevelInfo_c::entry_s *whatEntry =
dLevelInfo_c::s_info.searchBySlot(LastLevelPlayed[0], LastLevelPlayed[1]);
@@ -926,7 +928,7 @@ void dWMPathManager_c::execute() {
{10, 25, 1}, // SC right
};
- int w = LastLevelPlayed[0] + 1;
+ int w = (LastLevelPlayed[0] & 0x7F) + 1;
int l = LastLevelPlayed[1] + 1;
for (int i = 0; i < 11; i++) {
@@ -943,6 +945,7 @@ void dWMPathManager_c::execute() {
moveThroughPath(-1);
else
afterFortressMode = false;
+ return;
}
if (shouldRequestSave) {
@@ -1417,7 +1420,8 @@ void dWMPathManager_c::moveThroughPath(int pressedDir) {
dScKoopatlas_c::instance->keepMusicPlaying = true;
ActivateWipe(to->transition);
- DoSceneChange(WORLD_MAP, 0x10000000 | (to->foreignID << 20), 0);
+ u32 saveFlag = (shouldRequestSave ? 0x80000 : 0);
+ DoSceneChange(WORLD_MAP, 0x10000000 | (to->foreignID << 20) | saveFlag, 0);
} else if (reallyStop) {
// Stop here