FileSystemGCWii: Don't add 0-size files to m_offset_file_info_cache

This is done in order to reduce the risk of files not being added
due to them having the same end offset as another file.
This commit is contained in:
JosJuice 2017-08-01 19:57:06 +02:00
parent b155c46aca
commit f7032f8deb
1 changed files with 5 additions and 1 deletions

View File

@ -308,7 +308,11 @@ std::unique_ptr<FileInfo> FileSystemGCWii::FindFileInfo(u64 disc_offset) const
{
FileInfoGCWii file_info(m_root, i);
if (!file_info.IsDirectory())
m_offset_file_info_cache.emplace(file_info.GetOffset() + file_info.GetSize(), i);
{
const u32 size = file_info.GetSize();
if (size != 0)
m_offset_file_info_cache.emplace(file_info.GetOffset() + size, i);
}
}
}