diff options
author | Treeki <treeki@gmail.com> | 2012-09-27 00:51:43 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-09-27 00:51:43 +0200 |
commit | 014f3668eb47b1576bdc182b1db00417f9938cf1 (patch) | |
tree | cf7ade143858d17eb9d7c8114a67b82d60523a59 /src/koopatlas/pathmanager.cpp | |
parent | 46b65dfd76411bec6f8356c581f337f8a1944013 (diff) | |
download | kamek-014f3668eb47b1576bdc182b1db00417f9938cf1.tar.gz kamek-014f3668eb47b1576bdc182b1db00417f9938cf1.zip |
added untested support for world change nodes
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index e42246e..2401e04 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -573,8 +573,8 @@ void dWMPathManager_c::moveThroughPath() { if (to->type == dKPNode_s::LEVEL) { // Always stop on levels reallyStop = true; - } else if (to->type == dKPNode_s::CHANGE) { - // Never stop on entrances + } else if (to->type == dKPNode_s::CHANGE || to->type == dKPNode_s::WORLD_CHANGE) { + // Never stop on entrances or on world changes reallyStop = false; } else if (to->type == dKPNode_s::PASS_THROUGH) { // If there's only one exit here, then stop even though @@ -590,6 +590,34 @@ void dWMPathManager_c::moveThroughPath() { reallyStop = true; } + if (to->type == dKPNode_s::WORLD_CHANGE) { + // Set the current world info + SaveBlock *save = GetSaveFile()->GetBlock(-1); + + OSReport("Activating world change %d\n", to->worldID); + 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]; + } + + save->hudHintH = world->hudHintH; + save->hudHintS = world->hudHintS; + save->hudHintL = world->hudHintL; + + dWMHud_c::instance->hideAndShowFooter(); + } else { + OSReport("Not found!\n"); + } + } + if (to->type == dKPNode_s::CHANGE) { // Go to another map |