diff options
Diffstat (limited to 'src/koopatlas/pathmanager.cpp')
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 697b9fb..9741c4b 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -909,6 +909,42 @@ void dWMPathManager_c::execute() { return; } + if (shouldRequestSave && !checkedForMoveAfterEndLevel) { + checkedForMoveAfterEndLevel = true; + + static const int endLevels[11][3] = { + {1, 38, 1}, // W1 right + {2, 38, 2}, // W2 up + {3, 38, 0}, // W3 left + {4, 38, 1}, // W4 right + {5, 38, 1}, // W5 right + {6, 38, 2}, // W6 up + {7, 38, 1}, // W7 right + {10, 5, 2}, // GW up + {10, 10, 0}, // MM left + {10, 15, 3}, // CC down + {10, 25, 1}, // SC right + }; + + int w = LastLevelPlayed[0] + 1; + int l = LastLevelPlayed[1] + 1; + + for (int i = 0; i < 11; i++) { + if (endLevels[i][0] == w && endLevels[i][1] == l) { + afterFortressMode = true; + startMovementTo(currentNode->exits[endLevels[i][2]]); + return; + } + } + } + + if (afterFortressMode) { + if (isMoving) + moveThroughPath(-1); + else + afterFortressMode = false; + } + if (shouldRequestSave) { dScKoopatlas_c::instance->showSaveWindow(); shouldRequestSave = false; |