From 1706935abb52c334b226bc77631a7726835c2991 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Tue, 11 Oct 2022 18:28:32 +0300 Subject: [PATCH] Match CMemoryCardDriver::EraseFileSlot Former-commit-id: eec621aacc77dd2ff3028ed516f04aa66b116ce6 --- include/rstl/auto_ptr.hpp | 4 ++-- src/MetroidPrime/CMemoryCardDriver.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/rstl/auto_ptr.hpp b/include/rstl/auto_ptr.hpp index d3a70ddd..cb91e824 100644 --- a/include/rstl/auto_ptr.hpp +++ b/include/rstl/auto_ptr.hpp @@ -23,8 +23,8 @@ public: } // TODO check auto_ptr& operator=(const auto_ptr& other) { - if (this != &other) { - if (x0_has != false) { + if (&other != this) { + if (x0_has) { delete x4_item; } x0_has = other.x0_has; diff --git a/src/MetroidPrime/CMemoryCardDriver.cpp b/src/MetroidPrime/CMemoryCardDriver.cpp index e88459c5..7b178f14 100644 --- a/src/MetroidPrime/CMemoryCardDriver.cpp +++ b/src/MetroidPrime/CMemoryCardDriver.cpp @@ -706,7 +706,9 @@ void CMemoryCardDriver::ReadFinished() { } } -void CMemoryCardDriver::EraseFileSlot(int) {} +void CMemoryCardDriver::EraseFileSlot(int saveIdx) { + xe4_fileSlots[saveIdx] = nullptr; +} void CMemoryCardDriver::BuildNewFileSlot(int) {}