From cdcfc7ecccc9e648b8896e044ccf06f925533180 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 14 Mar 2022 02:07:16 -0400 Subject: [PATCH] Fix infinite loop when script object load fails --- Runtime/CStateManager.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 078ef018a..77b472b76 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -1556,15 +1556,8 @@ std::pair CStateManager::LoadScriptObject(TAreaId aid, ESc } if (error || ent == nullptr) { - while (in.GetReadPosition() != startPos) { - in.ReadChar(); - } - const std::string name = HashInstanceName(in); - while (in.GetReadPosition() != startPos + length) { - in.ReadChar(); - } - LogModule.report(logvisor::Error, FMT_STRING("Script load error while loading {}, name: {}"), - ScriptObjectTypeToStr(type), name); + LogModule.report(logvisor::Error, FMT_STRING("Script load error while loading {} (Editor ID: {}, Area: {})"), + ScriptObjectTypeToStr(type), id, aid); return {kInvalidEditorId, kInvalidUniqueId}; } else { #ifndef NDEBUG