Skip to content

Commit bd589ed

Browse files
authored
Reset session persistent shoe upgrade bools when achievements are reset (#1429)
1 parent d0cc13c commit bd589ed

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

UnleashedRecomp/user/achievement_manager.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "achievement_manager.h"
22
#include <os/logger.h>
3+
#include <kernel/memory.h>
34
#include <ui/achievement_overlay.h>
45
#include <user/config.h>
56

@@ -84,6 +85,24 @@ void AchievementManager::UnlockAll()
8485
void AchievementManager::Reset()
8586
{
8687
Data = {};
88+
89+
// The first usage of the shoe upgrades get stored within a session persistent boolean flag.
90+
// This causes issues with popping the achievement for the use of these abilities when the player
91+
// starts a new save file after they already used them in a session as these bools are never reset
92+
// unless the game is exited.
93+
// As a solution we reset these flags whenever the achievement data is being reset too.
94+
95+
// Lay the Smackdown
96+
*(bool*)g_memory.Translate(0x833647C5) = false;
97+
98+
// Wall Crawler
99+
*(bool*)g_memory.Translate(0x83363004) = false;
100+
101+
// Airdevil
102+
*(bool*)g_memory.Translate(0x833647BC) = false;
103+
104+
// Hyperdrive
105+
*(bool*)g_memory.Translate(0x833647C4) = false;
87106
}
88107

89108
void AchievementManager::Load()

0 commit comments

Comments
 (0)