From da404786ae3a781a9733a70b78b081370ea83531 Mon Sep 17 00:00:00 2001 From: Flayan Date: Mon, 18 Nov 2024 21:41:49 +0100 Subject: [PATCH] fix(VR): update clib with VR support for raindata (#757) --- extern/CommonLibSSE-NG | 2 +- src/Features/WetnessEffects.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extern/CommonLibSSE-NG b/extern/CommonLibSSE-NG index 37a8e5529..7c1b4c360 160000 --- a/extern/CommonLibSSE-NG +++ b/extern/CommonLibSSE-NG @@ -1 +1 @@ -Subproject commit 37a8e552982169acdc09cbe67776133d72643dd4 +Subproject commit 7c1b4c3607d581749573d1f639a364a1ebe8b243 diff --git a/src/Features/WetnessEffects.cpp b/src/Features/WetnessEffects.cpp index 3ade71f41..ab03e4f0f 100644 --- a/src/Features/WetnessEffects.cpp +++ b/src/Features/WetnessEffects.cpp @@ -262,8 +262,8 @@ WetnessEffects::PerFrame WetnessEffects::GetCommonBufferData() if (sky->mode.get() == RE::Sky::Mode::kFull) { if (auto currentWeather = sky->currentWeather) { if (currentWeather->precipitationData && currentWeather->data.flags.any(RE::TESWeather::WeatherDataFlag::kRainy)) { - float rainDensity = currentWeather->precipitationData->data[static_cast(RE::BGSShaderParticleGeometryData::DataID::kParticleDensity)].f; - float rainGravity = currentWeather->precipitationData->data[static_cast(RE::BGSShaderParticleGeometryData::DataID::kGravityVelocity)].f; + float rainDensity = currentWeather->precipitationData->GetSettingValue(RE::BGSShaderParticleGeometryData::DataID::kParticleDensity).f; + float rainGravity = currentWeather->precipitationData->GetSettingValue(RE::BGSShaderParticleGeometryData::DataID::kGravityVelocity).f; currentWeatherRaining = std::clamp(((rainDensity * rainGravity) / AVERAGE_RAIN_VOLUME), MIN_RAINDROP_CHANCE_MULTIPLIER, MAX_RAINDROP_CHANCE_MULTIPLIER); } currentWeatherID = currentWeather->GetFormID(); @@ -298,8 +298,8 @@ WetnessEffects::PerFrame WetnessEffects::GetCommonBufferData() CalculateWetness(lastWeather, sky, seconds, lastWeatherWetnessDepth, lastWeatherPuddleDepth); // If it was raining, wait to transition until precipitation ends, otherwise use the current weather's fade in if (lastWeather->precipitationData && lastWeather->data.flags.any(RE::TESWeather::WeatherDataFlag::kRainy)) { - float rainDensity = lastWeather->precipitationData->data[static_cast(RE::BGSShaderParticleGeometryData::DataID::kParticleDensity)].f; - float rainGravity = lastWeather->precipitationData->data[static_cast(RE::BGSShaderParticleGeometryData::DataID::kGravityVelocity)].f; + float rainDensity = lastWeather->precipitationData->GetSettingValue(RE::BGSShaderParticleGeometryData::DataID::kParticleDensity).f; + float rainGravity = lastWeather->precipitationData->GetSettingValue(RE::BGSShaderParticleGeometryData::DataID::kGravityVelocity).f; lastWeatherRaining = std::clamp(((rainDensity * rainGravity) / AVERAGE_RAIN_VOLUME), MIN_RAINDROP_CHANCE_MULTIPLIER, MAX_RAINDROP_CHANCE_MULTIPLIER); weatherTransitionPercentage = CalculateWeatherTransitionPercentage(sky->currentWeatherPct, lastWeather->data.precipitationEndFadeOut, false); } else {