mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-10-27 21:35:40 +00:00
fix: increased iw4 and iw5 peeking may result in a failbit in the stream
This commit is contained in:
2 files changed
+9
No files matched your search
@@ -36,6 +36,9 @@ std::expected<std::unique_ptr<Zone>, std::string> ZoneLoading::LoadZone(const st
|
||||
if (!zoneLoader)
|
||||
return std::unexpected(std::format("Could not create factory for zone '{}'.", zoneName));
|
||||
|
||||
// We may have to clear a fail bit if the peeking resulted in eof.
|
||||
// Otherwise, we cannot seek.
|
||||
file.clear();
|
||||
// Revert to beginning to make sure no peeking has advanced the read position.
|
||||
// (As different peeking logic may advance by different amounts of bytes).
|
||||
file.seekg(0, std::ios::beg);
|
||||
|
||||
Reference in new issue
Block a user