summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-27 05:25:01 +0200
committerTreeki <treeki@gmail.com>2012-09-27 05:25:01 +0200
commite30d836af369f251f83375dd9a9dbab435ee61f1 (patch)
tree3d40f1d067d0fdc845a848516a994b08f6faba19 /src
parent411c5a8e210b5cbca330a5438e2406dbe1ffecab (diff)
downloadkamek-e30d836af369f251f83375dd9a9dbab435ee61f1.tar.gz
kamek-e30d836af369f251f83375dd9a9dbab435ee61f1.zip
world change nodes now don't activate if you're already at that world
Diffstat (limited to 'src')
-rw-r--r--src/koopatlas/pathmanager.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index 896707a..97d9265 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -597,22 +597,26 @@ void dWMPathManager_c::moveThroughPath() {
OSReport("Activating world change %d\n", to->worldID);
const dKPWorldDef_s *world = dScKoopatlas_c::instance->mapData.findWorldDef(to->worldID);
if (world) {
- OSReport("Found!\n");
- strncpy(save->newerWorldName, world->name, 36);
- save->newerWorldName[35] = 0;
- 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];
- }
+ if (strncmp(save->newerWorldName, world->name, 36) == 0) {
+ OSReport("Already here\n");
+ } else {
+ OSReport("Found!\n");
+ strncpy(save->newerWorldName, world->name, 36);
+ save->newerWorldName[35] = 0;
+ 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->hudHintH = world->hudHintH;
+ save->hudHintS = world->hudHintS;
+ save->hudHintL = world->hudHintL;
- dWMHud_c::instance->hideAndShowFooter();
+ dWMHud_c::instance->hideAndShowFooter();
+ }
} else {
OSReport("Not found!\n");
}