summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-28 05:43:53 +0200
committerTreeki <treeki@gmail.com>2012-08-28 05:43:53 +0200
commitef835d9dd72a5d70e5361f87654e6aa1f0ae35a5 (patch)
tree726bb32010dda0e72a20e7fe60ce74bf7d08588a
parent2dc6dc90e21d12186bb1a88b81fd8f74baea4fbe (diff)
downloadkamek-ef835d9dd72a5d70e5361f87654e6aa1f0ae35a5.tar.gz
kamek-ef835d9dd72a5d70e5361f87654e6aa1f0ae35a5.zip
fixed some bugs in the path manager
-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;