summaryrefslogtreecommitdiff
path: root/src/koopatlas
diff options
context:
space:
mode:
Diffstat (limited to 'src/koopatlas')
-rw-r--r--src/koopatlas/pathmanager.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index 9ecc8d5..6c58107 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -18,6 +18,11 @@ void dWMPathManager_c::setup() {
mustComplainToMapCreator = false;
+ SpammyReport("Unlocking paths\n");
+ isEnteringLevel = false;
+ unlockPaths();
+ SpammyReport("done\n");
+
// Figure out what path node to start at
if (dScKoopatlas_c::instance->settings & 0x10000000) {
// Start off from a "Change"
@@ -61,11 +66,6 @@ void dWMPathManager_c::setup() {
}
}
- SpammyReport("Unlocking paths\n");
- isEnteringLevel = false;
- unlockPaths();
- SpammyReport("done\n");
-
for (int i = 0; i < pathLayer->nodeCount; i++)
if (pathLayer->nodes[i]->type == dKPNode_s::LEVEL)
pathLayer->nodes[i]->setupNodeExtra();
@@ -489,14 +489,20 @@ void dWMPathManager_c::moveThroughPath() {
SpammyReport("reached path end (%p)\n", to);
- // Quick check: do we *actually* need to stop on this node?
- // If it's a junction with more than two exits, but only two are open,
- // take the opposite open one
- bool stopOverride = false;
+ bool reallyStop = false;
- if (to->type == dKPNode_s::STOP) {
- if (to->getExitCount() > 2 && to->getAvailableExitCount() == 2)
- stopOverride = true;
+ if (to->type == dKPNode_s::PASS_THROUGH) {
+ // If there's only one exit here, then stop even though
+ // it's a passthrough node
+ reallyStop = (to->getAvailableExitCount() == 1);
+ } else {
+ // Quick check: do we *actually* need to stop on this node?
+ // If it's a junction with more than two exits, but only two are open,
+ // take the opposite open one
+ if (to->getExitCount() > 2 && to->getAvailableExitCount() == 2)
+ reallyStop = false;
+ else
+ reallyStop = true;
}
if (to->type == dKPNode_s::CHANGE) {
@@ -511,7 +517,7 @@ void dWMPathManager_c::moveThroughPath() {
DoSceneChange(WORLD_MAP, 0x10000000 | to->foreignID, 0);
- } else if (to->type != dKPNode_s::PASS_THROUGH && !stopOverride) {
+ } else if (reallyStop) {
// Stop here
player->startAnimation(0, 1.2, 10.0, 0.0);
player->hasEffect = false;