CStateManager: Fix wrong stream position on error

This commit is contained in:
Luke Street 2020-04-19 21:27:08 -04:00
parent d5fcb4a917
commit 764432882c
1 changed files with 1 additions and 0 deletions

View File

@ -1379,6 +1379,7 @@ std::pair<TEditorId, TUniqueId> CStateManager::LoadScriptObject(TAreaId aid, ESc
if (error || ent == nullptr) {
in.seek(startPos, athena::SeekOrigin::Begin);
std::string name = HashInstanceName(in);
in.seek(length, athena::SeekOrigin::Current);
LogModule.report(logvisor::Error, FMT_STRING("Script load error while loading {}, name: {}"),
ScriptObjectTypeToStr(type), name);
return {kInvalidEditorId, kInvalidUniqueId};