From 431e6c42e1d2543141505c1d7016ba94c3363acb Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 21 Nov 2018 00:14:38 +0100 Subject: [PATCH] GCMemcard: Fix incorrect directory block being accessed in RemoveFile(). When deleting files, block index data was always fetched from the first copy of the directory listing rather than the currently active one. --- Source/Core/Core/HW/GCMemcard/GCMemcard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp index cf0ff40331..fd04f69063 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp @@ -739,8 +739,8 @@ u32 GCMemcard::RemoveFile(u8 index) // index in the directory array if (index >= DIRLEN) return DELETE_FAIL; - u16 startingblock = BE16(dir.Dir[index].FirstBlock); - u16 numberofblocks = BE16(dir.Dir[index].BlockCount); + u16 startingblock = BE16(CurrentDir->Dir[index].FirstBlock); + u16 numberofblocks = BE16(CurrentDir->Dir[index].BlockCount); BlockAlloc UpdatedBat = *CurrentBat; if (!UpdatedBat.ClearBlocks(startingblock, numberofblocks))