Skip to content

Commit a90a1c2

Browse files
committed
Workaround for references not storing original file
1 parent 52f6b80 commit a90a1c2

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

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_BaseObjectSwapper" CACHE STRING "")
3-
set(VERSION 3.4.0 CACHE STRING "")
3+
set(VERSION 3.4.1 CACHE STRING "")
44
set(VR_VERSION 1)
55
set(AE_VERSION 1)
66

src/RNG.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ std::uint64_t BOS_RNG::get_form_seed(const RE::TESForm* a_form)
55
if (a_form->IsDynamicForm()) {
66
return a_form->GetFormID();
77
}
8-
8+
99
std::uint64_t result = 0;
1010
boost::hash_combine(result, a_form->GetLocalFormID());
11-
boost::hash_combine(result, a_form->GetFile(0)->GetFilename());
11+
12+
auto fileName = a_form->GetFile(0)->GetFilename();
13+
if (a_form->AsReference() && (a_form->GetFormID() & 0xFF000000) == 0) {
14+
fileName = "Skyrim.esm"sv;
15+
}
16+
boost::hash_combine(result, fileName);
17+
1218
return result;
1319
}
1420

vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "base-object-swapper",
3-
"version-string": "3.4.0",
3+
"version-string": "3.4.1",
44
"description": "Base Object Swapper",
55
"homepage": "",
66
"license": "MIT",

0 commit comments

Comments
 (0)