From e30d836af369f251f83375dd9a9dbab435ee61f1 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 27 Sep 2012 05:25:01 +0200 Subject: world change nodes now don't activate if you're already at that world --- src/koopatlas/pathmanager.cpp | 32 ++++++++++++++++++-------------- 1 file 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"); } -- cgit v1.2.3