From b51838ab2b1056db506124394552c44f2032064b Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Wed, 7 Aug 2024 20:47:01 +0200 Subject: [PATCH] Fixed script version checks not always firing --- source/Enderal DLL/CMakeLists.txt | 2 +- source/Enderal DLL/src/EventListener.cpp | 2 -- source/Enderal DLL/src/Main.cpp | 3 +++ source/Enderal DLL/src/Util.h | 4 ++-- source/Enderal DLL/vcpkg.json | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/Enderal DLL/CMakeLists.txt b/source/Enderal DLL/CMakeLists.txt index 98821769..b9317399 100644 --- a/source/Enderal DLL/CMakeLists.txt +++ b/source/Enderal DLL/CMakeLists.txt @@ -6,7 +6,7 @@ message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.") ######################################################################################################################## project( EnderalSE - VERSION 2.1.2 + VERSION 2.1.3 DESCRIPTION "Enderal SE DLL" LANGUAGES CXX) set(CMAKE_CXX_STANDARD 23) diff --git a/source/Enderal DLL/src/EventListener.cpp b/source/Enderal DLL/src/EventListener.cpp index 0291cf5b..3f32d5a3 100644 --- a/source/Enderal DLL/src/EventListener.cpp +++ b/source/Enderal DLL/src/EventListener.cpp @@ -60,8 +60,6 @@ auto EventListener::ProcessEvent( } else { if (a_event->menuName == RE::DialogueMenu::MENU_NAME) { DialogueMenuPatch::BlockTab(false); - } else if (a_event->menuName == RE::MainMenu::MENU_NAME) { - CheckScriptVersions(); } } diff --git a/source/Enderal DLL/src/Main.cpp b/source/Enderal DLL/src/Main.cpp index 469b1501..27736b60 100644 --- a/source/Enderal DLL/src/Main.cpp +++ b/source/Enderal DLL/src/Main.cpp @@ -135,6 +135,9 @@ namespace { }); } else if ((message->type == MessagingInterface::kPostLoadGame && message->data) || message->type == MessagingInterface::kNewGame) { NewGameCount(true); + if (NewGameCount() == 1) { + CheckScriptVersions(); + } } }); } diff --git a/source/Enderal DLL/src/Util.h b/source/Enderal DLL/src/Util.h index f8cf6987..7429db03 100644 --- a/source/Enderal DLL/src/Util.h +++ b/source/Enderal DLL/src/Util.h @@ -82,7 +82,7 @@ inline void CheckScriptVersions() expectedVersion(a_version) { 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); @@ -113,7 +113,7 @@ inline void CheckScriptVersions() scripts["_00E_Phasmalist_NewApparitionAlias"] = 1; scripts["_FS_Phasmalist_ControlQuest"] = 1; scripts["_00E_Phasmalist_Workbench"] = 1; - scripts["_00E_Theriantrophist_PlayerAsWerewolf"] = 1; + scripts["_00E_Theriantrophist_PlayerAsWerewolf"] = 2; scripts["_00E_Theriantrophist_AlchemyControl"] = 1; scripts["_00E_PlayerhousingMaster"] = 1; scripts["_00E_ContainerBonusControl"] = 2; diff --git a/source/Enderal DLL/vcpkg.json b/source/Enderal DLL/vcpkg.json index a0cd6af3..73f9fad3 100644 --- a/source/Enderal DLL/vcpkg.json +++ b/source/Enderal DLL/vcpkg.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", "name": "enderal-se", - "version-string": "2.1.0", + "version-string": "2.1.3", "port-version": 0, "description": "Enderal SE Helper", "homepage": "https://mod.pub/enderal-se/38-enderal-se",