diff --git a/extern/CommonLibSSE-NG b/extern/CommonLibSSE-NG index c4672d5d7..37a8e5529 160000 --- a/extern/CommonLibSSE-NG +++ b/extern/CommonLibSSE-NG @@ -1 +1 @@ -Subproject commit c4672d5d70183f151e1dc470e73a747b78511304 +Subproject commit 37a8e552982169acdc09cbe67776133d72643dd4 diff --git a/src/Features/LightLimitFix.cpp b/src/Features/LightLimitFix.cpp index d9263b824..d79679231 100644 --- a/src/Features/LightLimitFix.cpp +++ b/src/Features/LightLimitFix.cpp @@ -687,6 +687,12 @@ float3 LightLimitFix::Saturation(float3 color, float saturation) return color; } +namespace RE +{ + class BSMultiBoundRoom : public NiNode + {}; +} + void LightLimitFix::UpdateLights() { static float& cameraNear = (*(float*)(REL::RelocationID(517032, 403540).address() + 0x40)); @@ -712,9 +718,8 @@ void LightLimitFix::UpdateLights() roomNodes.empty(); - auto addRoom = [&](void* nodePtr, LightData& light) { + auto addRoom = [&](RE::NiNode* node, LightData& light) { uint8_t roomIndex = 0; - auto* node = static_cast(nodePtr); if (auto it = roomNodes.find(node); it == roomNodes.cend()) { roomIndex = static_cast(roomNodes.size()); roomNodes.insert_or_assign(node, roomIndex); @@ -739,17 +744,12 @@ void LightLimitFix::UpdateLights() if (!IsGlobalLight(bsLight)) { // List of BSMultiBoundRooms affected by a light - for (const auto& roomPtr : bsLight->unk0D8) { + for (const auto& roomPtr : bsLight->rooms) { addRoom(roomPtr, light); } // List of BSPortals affected by a light - for (const auto& portalPtr : bsLight->unk0F0) { - struct BSPortal - { - uint8_t data[0x128]; - void* portalSharedNode; - }; - addRoom(static_cast(portalPtr)->portalSharedNode, light); + for (const auto& portalPtr : bsLight->portals) { + addRoom(portalPtr->portalSharedNode.get(), light); } light.lightFlags.set(LightFlags::PortalStrict); } diff --git a/src/XSEPlugin.cpp b/src/XSEPlugin.cpp index c7295b93f..f49ce6332 100644 --- a/src/XSEPlugin.cpp +++ b/src/XSEPlugin.cpp @@ -61,8 +61,8 @@ extern "C" DLLEXPORT constinit auto SKSEPlugin_Version = []() noexcept { SKSE::PluginVersionData v; v.PluginName(Plugin::NAME.data()); v.PluginVersion(Plugin::VERSION); - v.UsesAddressLibrary(true); - v.HasNoStructUse(); + v.UsesAddressLibrary(); + v.UsesNoStructs(); return v; }();