Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cd41e8

Browse files
committed
2 parents 81660df + a90a1c2 commit 2cd41e8

20 files changed

Lines changed: 173 additions & 64 deletions

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
FOMOD_AE_DESCR: 'Select this if you are using Skyrim Anniversary Edition v1.6.1130 or higher (latest update).'
3131
FOMOD_AE_MIN_GAME_VERSION: '1.6.1130.0'
3232
PUBLISH_ARCHIVE_TYPE: '7z'
33-
VCPKG_COMMIT_ID: 'f7423ee180c4b7f40d43402c2feb3859161ef625'
33+
VCPKG_COMMIT_ID: '53b9816594558d0b78529ecce2bf4a97d0a0729e'

CMakeLists.txt

Lines changed: 3 additions & 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.1.1 CACHE STRING "")
3+
set(VERSION 3.4.1 CACHE STRING "")
44
set(VR_VERSION 1)
55
set(AE_VERSION 1)
66

@@ -134,6 +134,7 @@ else ()
134134
endif()
135135

136136
find_package(unordered_dense CONFIG REQUIRED)
137+
find_package(boost_container_hash CONFIG REQUIRED)
137138

138139
find_path(SRELL_INCLUDE_DIRS "srell.hpp")
139140
find_path(MERGEMAPPER_INCLUDE_DIRS "MergeMapperPluginAPI.h")
@@ -200,6 +201,7 @@ target_link_libraries(
200201
PRIVATE
201202
${CommonLibName}::${CommonLibName}
202203
unordered_dense::unordered_dense
204+
Boost::container_hash
203205
)
204206

205207
target_precompile_headers(

CMakePresets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"hidden": true,
1212
"cacheVariables": {
1313
"CMAKE_CONFIGURATION_TYPES": "Debug;Release",
14-
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4 /external:anglebrackets /external:W0 $penv{CXXFLAGS}"
14+
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4 /external:W0 $penv{CXXFLAGS}",
15+
"CMAKE_CXX_FLAGS_RELEASE": "/O2 /DNDEBUG"
1516
},
1617
"errors": {
1718
"deprecated": true

cmake/ports/clib-util/portfile.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
vcpkg_from_github(
33
OUT_SOURCE_PATH SOURCE_PATH
44
REPO powerof3/CLibUtil
5-
REF a491e2f7919211eac6d32dd2814b7908134ec1b2
6-
SHA512 e6b830a061d7fc99115ee7d28de0165b8c6281006df6d053342e6b5b85606a46a846ebb30f3e4598aa976c25cfe7a9dffd1c4eb72942829d1a4615d81e62cf3c
5+
REF a7a877a0551592cba58f7fc36d94d1a6d1a14db9
6+
SHA512 cfebe14121c41f2400bc85deeb881d631ecf0a9216bca7e963b5c7ef5de46d4048752dae1552915fb9927d25f71d430c6d2f92be195a8130ec15a5457491d473
77
HEAD_REF master
88
)
99

cmake/ports/clib-util/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "clib-util",
3-
"version-string": "1.4.0",
3+
"version-string": "1.4.4",
44
"port-version": 1,
55
"description": "",
66
"homepage": "https://github.com/powerof3/CLibUtil"

extern/CommonLibSSE

Submodule CommonLibSSE updated 1164 files

extern/CommonLibVR

Submodule CommonLibVR updated 1180 files

src/ConditionalData.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ bool ConditionalInput::IsValid(RE::FormID a_formID) const
4848
}
4949
case RE::FormType::Cell:
5050
return currentCell == form;
51+
case RE::FormType::WorldSpace:
52+
{
53+
const auto worldspace = form->As<RE::TESWorldSpace>();
54+
return currentWorldspace && (currentWorldspace == worldspace || currentWorldspace->parentWorld == worldspace);
55+
}
5156
default:
5257
break;
5358
}

src/ConditionalData.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct ConditionFilters
1717
}
1818

1919
// members
20-
std::string conditionID{}; // path|condition1,condition2
20+
std::string conditionID{}; // path|condition1,condition2
2121
std::vector<FormIDStr> NOT{};
2222
std::vector<FormIDStr> MATCH{};
2323
};
@@ -31,6 +31,7 @@ struct ConditionalInput
3131
ref(a_ref),
3232
base(a_form),
3333
currentCell(a_ref->GetSaveParentCell()),
34+
currentWorldspace(a_ref->GetWorldspace()),
3435
currentLocation(a_ref->GetCurrentLocation()),
3536
currentRegionList(currentCell ? currentCell->GetRegionList(false) : nullptr)
3637
{}
@@ -45,6 +46,7 @@ struct ConditionalInput
4546
const RE::TESObjectREFR* ref;
4647
const RE::TESForm* base;
4748
RE::TESObjectCELL* currentCell;
49+
RE::TESWorldSpace* currentWorldspace;
4850
RE::BGSLocation* currentLocation;
4951
RE::TESRegionList* currentRegionList;
5052
};

src/Manager.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,25 +217,27 @@ namespace FormSwap
217217
return { nullptr, std::nullopt };
218218
};
219219

220+
// references -> conditional forms -> forms
220221
if (!a_ref->IsDynamicForm()) {
221222
swapData = get_swap_base(a_ref, swapRefs);
222223
}
223-
224224
if (!swapData.first) {
225225
swapData = GetSwapFormConditional(a_ref, a_base);
226226
}
227-
228227
if (!swapData.first) {
229228
swapData = get_swap_base(a_base, swapForms);
230229
}
231230

231+
// process leveled swaps. do not swap if leveled item has encounter zone
232232
if (const auto swapLvlBase = swapData.first ? swapData.first->As<RE::TESLevItem>() : nullptr) {
233233
if (a_ref->GetEncounterZone() == nullptr) {
234234
RE::BSScrapArray<RE::CALCED_OBJECT> calcedObjects{};
235235
swapLvlBase->CalculateCurrentFormList(a_ref->GetCalcLevel(false), 1, calcedObjects, 0, true);
236236
if (!calcedObjects.empty()) {
237237
swapData.first = static_cast<RE::TESBoundObject*>(calcedObjects.front().form);
238238
}
239+
} else {
240+
swapData.first = nullptr;
239241
}
240242
}
241243

@@ -255,14 +257,13 @@ namespace FormSwap
255257
return a_result && a_result->IsValid();
256258
};
257259

260+
// references -> conditional forms -> forms
258261
if (!has_properties(swapData.second) && !a_ref->IsDynamicForm()) {
259262
swapData.second = get_properties(a_ref);
260263
}
261-
262264
if (!has_properties(swapData.second)) {
263265
swapData.second = GetObjectPropertiesConditional(a_ref, a_base);
264266
}
265-
266267
if (!has_properties(swapData.second)) {
267268
swapData.second = get_properties(a_base);
268269
}

0 commit comments

Comments
 (0)