diff options
author | Treeki <treeki@gmail.com> | 2013-02-14 01:59:52 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-02-14 01:59:52 +0100 |
commit | ac80973ee96dc7d65a8c8b4861a69e8e189c7434 (patch) | |
tree | d582042af1938b2b67f6da4c7823f925364cbe99 | |
parent | 7f51207e18658fa83f694d3f9693bc284e6b076d (diff) | |
download | kamek-ac80973ee96dc7d65a8c8b4861a69e8e189c7434.tar.gz kamek-ac80973ee96dc7d65a8c8b4861a69e8e189c7434.zip |
fix a bug with the w7 to w8 transition. untested though
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 43 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.h | 2 |
2 files changed, 28 insertions, 17 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index dd291cb..7f7239b 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -154,6 +154,9 @@ void dWMPathManager_c::setup() { MaybeFinishingLevel[0] = 0xFF; } + + if (wm->isAfterKamekCutscene) + copyWorldDefToSave(wm->mapData.findWorldDef(1)); } static u8 *PathAvailabilityData = 0; @@ -808,23 +811,7 @@ void dWMPathManager_c::moveThroughPath(int pressedDir) { } OSReport("Found!\n"); - strncpy(save->newerWorldName, world->name, 32); - save->newerWorldName[31] = 0; - save->newerWorldID = world->worldID; - save->currentMapMusic = world->trackID; - - for (int i = 0; i < 2; i++) { - save->fsTextColours[i] = world->fsTextColours[i]; - save->fsHintColours[i] = world->fsHintColours[i]; - save->hudTextColours[i] = world->hudTextColours[i]; - } - - save->hudHintH = world->hudHintH; - save->hudHintS = world->hudHintS; - save->hudHintL = world->hudHintL; - - save->titleScreenWorld = world->titleScreenWorld; - save->titleScreenLevel = world->titleScreenLevel; + copyWorldDefToSave(world); bool wzHack = false; if (dScKoopatlas_c::instance->warpZoneHacks) { @@ -909,6 +896,28 @@ void dWMPathManager_c::moveThroughPath(int pressedDir) { } } +void dWMPathManager_c::copyWorldDefToSave(const dKPWorldDef_s *world) { + SaveBlock *save = GetSaveFile()->GetBlock(-1); + + strncpy(save->newerWorldName, world->name, 32); + save->newerWorldName[31] = 0; + save->newerWorldID = world->worldID; + save->currentMapMusic = world->trackID; + + for (int i = 0; i < 2; i++) { + save->fsTextColours[i] = world->fsTextColours[i]; + save->fsHintColours[i] = world->fsHintColours[i]; + save->hudTextColours[i] = world->hudTextColours[i]; + } + + save->hudHintH = world->hudHintH; + save->hudHintS = world->hudHintS; + save->hudHintL = world->hudHintL; + + save->titleScreenWorld = world->titleScreenWorld; + save->titleScreenLevel = world->titleScreenLevel; +} + void dWMPathManager_c::activatePoint() { if (levelStartWait >= 0) return; diff --git a/src/koopatlas/pathmanager.h b/src/koopatlas/pathmanager.h index 18a08c9..8f04e34 100644 --- a/src/koopatlas/pathmanager.h +++ b/src/koopatlas/pathmanager.h @@ -32,6 +32,8 @@ class dWMPathManager_c { void activatePoint(); void unlockAllPaths(char type); + void copyWorldDefToSave(const dKPWorldDef_s *world); + dKPLayer_s *pathLayer; bool isMoving; |