summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2013-04-18 20:38:29 -0500
committerColin Noga <Tempus@chronometry.ca>2013-04-18 20:38:29 -0500
commit3abe5505fc51f1b397d4659c9e82faf19bc01629 (patch)
tree207c24cd5525c101149762bdf782976bf2f51142 /src/koopatlas/pathmanager.cpp
parent93faabab3cebc0bca795c0d8c1ad832b0c619134 (diff)
parent3c7beae513ce1d9ff226415e14f834645b1afeb4 (diff)
downloadkamek-3abe5505fc51f1b397d4659c9e82faf19bc01629.tar.gz
kamek-3abe5505fc51f1b397d4659c9e82faf19bc01629.zip
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to 'src/koopatlas/pathmanager.cpp')
-rw-r--r--src/koopatlas/pathmanager.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index ad39c69..697b9fb 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -18,6 +18,7 @@ bool CanFinishAllCoins = false;
bool CanFinishAllExits = false;
bool CanFinishEverything = false;
void ResetAllCompletionCandidates() {
+ // This is called by File Select, btw
MaybeFinishingLevel[0] = 0xFF;
LastLevelPlayed[0] = 0xFF;
CanFinishCoins = false;
@@ -273,15 +274,23 @@ void dWMPathManager_c::setup() {
static u8 *PathAvailabilityData = 0;
static u8 *NodeAvailabilityData = 0;
-dWMPathManager_c::~dWMPathManager_c() {
- bool entering8_25 = (MaybeFinishingLevel[0] == 7) && (MaybeFinishingLevel[1] == 24);
- if (PathAvailabilityData && !isEnteringLevel && !entering8_25) {
+void ClearOldPathAvailabilityData() {
+ // This is called by File Select
+ if (PathAvailabilityData) {
delete[] PathAvailabilityData;
PathAvailabilityData = 0;
-
+ }
+ if (NodeAvailabilityData) {
delete[] NodeAvailabilityData;
NodeAvailabilityData = 0;
}
+}
+
+dWMPathManager_c::~dWMPathManager_c() {
+ bool entering8_25 = (MaybeFinishingLevel[0] == 7) && (MaybeFinishingLevel[1] == 24);
+ if (!isEnteringLevel && !entering8_25) {
+ ClearOldPathAvailabilityData();
+ }
if (isEnteringLevel) {
ResetAllCompletionCandidates();