diff --git a/source/Enderal DLL/src/Util.h b/source/Enderal DLL/src/Util.h index 80449f3c..ac9207bc 100644 --- a/source/Enderal DLL/src/Util.h +++ b/source/Enderal DLL/src/Util.h @@ -85,8 +85,9 @@ inline void CheckScriptVersions() scriptName(a_scriptName), expectedVersion(a_version) { - if (PapyrusGlobalFunctionExists(scriptName.c_str(), funcName.c_str())) { - const auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton(); + const auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton(); + + if (vm->TypeIsValid(scriptName) && PapyrusGlobalFunctionExists(scriptName.c_str(), funcName.c_str())) { auto callbackPtr = RE::BSTSmartPointer(this); vm->DispatchStaticCall(scriptName, funcName, RE::MakeFunctionArguments(), callbackPtr); } else { @@ -124,7 +125,7 @@ inline void CheckScriptVersions() new ScriptVersionCallback("_00E_PlayerhousingMaster", 1) }; RE::BSTSmartPointer{ - new ScriptVersionCallback("_00E_ContainerController", 1) + new ScriptVersionCallback("_00E_ContainerBonusControl", 1) }; }