From 1c178768f54e1d988b471a98dbee1e269b0ff68e Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 5 Sep 2014 16:43:20 +0200 Subject: [PATCH] Allow Script records with missing SCDT (precompiled code, not used anyway) Not sure on the exact conditions, but this was missing in a plugin that I made in the TES-CS, while vanilla MW would load it just fine. --- components/esm/loadscpt.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/esm/loadscpt.cpp b/components/esm/loadscpt.cpp index fff68962f..f3813adca 100644 --- a/components/esm/loadscpt.cpp +++ b/components/esm/loadscpt.cpp @@ -64,8 +64,11 @@ void Script::load(ESMReader &esm) } // Script mData - mScriptData.resize(mData.mScriptDataSize); - esm.getHNExact(&mScriptData[0], mScriptData.size(), "SCDT"); + if (esm.isNextSub("SCDT")) + { + mScriptData.resize(mData.mScriptDataSize); + esm.getHExact(&mScriptData[0], mScriptData.size()); + } // Script text mScriptText = esm.getHNOString("SCTX");