aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/fsmitm_romfsbuild.h
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-07-12 04:31:01 -0400
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-07-12 04:33:35 -0400
commitfd1c3aa14ebda34687b7a4e4e58e1836f7394df8 (patch)
tree5da6c5aa9a03bbe13c37776e3c7f6f2995e474ed /src/core/file_sys/fsmitm_romfsbuild.h
parente60733aad35d430de7cd88a4e352e726ad5740ca (diff)
fs: Fix RomFS building when zero byte files are present
When zero byte files are present, the key (offset) for that file is identical to the file right after. A std::map isn't able to fit key-value pairs with identical keys (offsets), therefore, the solution is to use std::multimap which permits multiple entries with the same key. This most prominently fixes Pokemon Sword and Shield weather with any RomFS mod applied.
Diffstat (limited to 'src/core/file_sys/fsmitm_romfsbuild.h')
-rw-r--r--src/core/file_sys/fsmitm_romfsbuild.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/file_sys/fsmitm_romfsbuild.h b/src/core/file_sys/fsmitm_romfsbuild.h
index a62502193..049de180b 100644
--- a/src/core/file_sys/fsmitm_romfsbuild.h
+++ b/src/core/file_sys/fsmitm_romfsbuild.h
@@ -43,7 +43,7 @@ public:
~RomFSBuildContext();
// This finalizes the context.
- std::map<u64, VirtualFile> Build();
+ std::multimap<u64, VirtualFile> Build();
private:
VirtualDir base;