From 6480a694376141f22c9708e569ef7d62544e4e38 Mon Sep 17 00:00:00 2001 From: TheRiverwoodModder <125157333+TheRiverwoodModder@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:08:28 -0700 Subject: [PATCH] fix: fix crash in soul cairn --- CMakeLists.txt | 2 +- features/Wetness Effects/Shaders/Features/WetnessEffects.ini | 2 +- src/Features/WetnessEffects.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93c4a13ad..d87091960 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.21) project( CommunityShaders - VERSION 0.8.6 + VERSION 0.8.7 LANGUAGES CXX ) diff --git a/features/Wetness Effects/Shaders/Features/WetnessEffects.ini b/features/Wetness Effects/Shaders/Features/WetnessEffects.ini index 19f01444d..735cfd23a 100644 --- a/features/Wetness Effects/Shaders/Features/WetnessEffects.ini +++ b/features/Wetness Effects/Shaders/Features/WetnessEffects.ini @@ -1,2 +1,2 @@ [Info] -Version = 1-0-0 \ No newline at end of file +Version = 1-0-1 \ No newline at end of file diff --git a/src/Features/WetnessEffects.cpp b/src/Features/WetnessEffects.cpp index 6024c8d3a..086f98e1c 100644 --- a/src/Features/WetnessEffects.cpp +++ b/src/Features/WetnessEffects.cpp @@ -324,7 +324,7 @@ void WetnessEffects::Draw(const RE::BSShader* shader, const uint32_t) lastWeatherID = lastWeather->GetFormID(); 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->data.flags.any(RE::TESWeather::WeatherDataFlag::kRainy)) { + 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; lastWeatherRaining = std::clamp(((rainDensity * rainGravity) / AVERAGE_RAIN_VOLUME), MIN_RAINDROP_CHANCE_MULTIPLIER, MAX_RAINDROP_CHANCE_MULTIPLIER);