Skip to content

Commit 1bbcc53

Browse files
committed
Fix SNDR editorID issue
1 parent ce2f51b commit 1bbcc53

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.20)
22
set(NAME "po3_Tweaks" CACHE STRING "")
3-
set(VERSION 1.14.0 CACHE STRING "")
3+
set(VERSION 1.14.1 CACHE STRING "")
44
set(AE_VERSION 1)
55
set(VR_VERSION 1)
66

src/Fixes/CacheEditorIDs.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ namespace Fixes::CacheFormEditorIDs
4545
static constexpr size_t idx{ 0x33 };
4646
};
4747

48+
struct SetFormEditorID_SNDR
49+
{
50+
static bool thunk(RE::TESForm* a_this, const char* a_str)
51+
{
52+
if (!string::is_empty(a_str) && !a_this->IsDynamicForm()) {
53+
Cache::EditorID::GetSingleton()->CacheEditorID(a_this, a_str);
54+
}
55+
return func(a_this, a_str);
56+
}
57+
static inline REL::Relocation<decltype(thunk)> func;
58+
static constexpr size_t idx{ 0x33 };
59+
};
60+
4861
struct TESFile_GetChunkData
4962
{
5063
static bool thunk(RE::TESFile* a_this, void* ptr, std::uint32_t a_chunkSize)
@@ -220,7 +233,7 @@ namespace Fixes::CacheFormEditorIDs
220233
stl::write_vfunc<RE::BGSMaterialObject, SetFormEditorID>();
221234
stl::write_vfunc<RE::BGSMovementType, SetFormEditorID>();
222235

223-
stl::write_vfunc<RE::BGSSoundDescriptorForm, SetFormEditorID>();
236+
stl::write_vfunc<RE::BGSSoundDescriptorForm, SetFormEditorID_SNDR>();
224237

225238
stl::write_vfunc<RE::BGSDualCastData, SetFormEditorID>();
226239
stl::write_vfunc<RE::BGSSoundCategory, SetFormEditorID>();

vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "po3tweaks",
3-
"version-string": "1.14.0",
3+
"version-string": "1.14.1",
44
"description": "Collection of bug fixes and tweaks for Skyrim SE/AE/VR",
55
"homepage": "https://github.com/powerof3/po3-Tweaks/",
66
"license": "MIT",

0 commit comments

Comments
 (0)