diff options
Diffstat (limited to 'src/koopatlas')
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 579934a..b555b41 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -504,9 +504,15 @@ void dWMPathManager_c::unlockPaths() { newlyAvailablePaths = 0; newlyAvailableNodes = 0; - if (oldPathAvData) { + dScKoopatlas_c *wm = dScKoopatlas_c::instance; + bool forceFlag = (wm->isAfter8Castle || wm->isAfterKamekCutscene); + + if (oldPathAvData || forceFlag) { for (int i = 0; i < pathLayer->pathCount; i++) { - if ((PathAvailabilityData[i] > 0) && (oldPathAvData[i] == 0)) { + if ((PathAvailabilityData[i] > 0) && (forceFlag || oldPathAvData[i] == 0)) { + if (forceFlag && PathAvailabilityData[i] == dKPPath_s::ALWAYS_AVAILABLE) + continue; + dKPPath_s *path = pathLayer->paths[i]; path->isAvailable = dKPPath_s::NEWLY_AVAILABLE; newlyAvailablePaths++; @@ -515,17 +521,20 @@ void dWMPathManager_c::unlockPaths() { path->setLayerAlpha(0); } } - delete[] oldPathAvData; // check nodes too for (int i = 0; i < pathLayer->nodeCount; i++) { - if ((NodeAvailabilityData[i] > 0) && (oldNodeAvData[i] == 0)) { + if ((NodeAvailabilityData[i] > 0) && (forceFlag || oldNodeAvData[i] == 0)) { dKPNode_s *node = pathLayer->nodes[i]; node->isNew = true; newlyAvailableNodes++; } } - delete[] oldNodeAvData; + + if (oldPathAvData) { + delete[] oldPathAvData; + delete[] oldNodeAvData; + } } // now set all node alphas |