From 7f5806b727490e98ac606a5500ac9949d012aef5 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 1 Nov 2020 10:29:28 +0100 Subject: tiny cleanup --- src/render/WindModifiers.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/render/WindModifiers.cpp b/src/render/WindModifiers.cpp index b72e362e..3bd6ac9c 100644 --- a/src/render/WindModifiers.cpp +++ b/src/render/WindModifiers.cpp @@ -33,8 +33,9 @@ CWindModifiers::FindWindModifier(CVector pos, float *x, float *y) float dist = (pos - Array[i].m_pos).Magnitude(); if (dist < MAX_FADE_DIST) { float distFade = dist < MIN_FADE_DIST ? 1.0f : 1.0f - (dist - MIN_FADE_DIST) / (MAX_FADE_DIST - MIN_FADE_DIST); - float heightFade = distFade * ((1.0f - zDist / MAX_HEIGHT_DIST) / 2.0f); - dir = (pos - Array[i].m_pos) * heightFade / dist; + float heightFade = 1.0f - zDist / MAX_HEIGHT_DIST; + float fade = distFade * heightFade * 0.5f; + dir = (pos - Array[i].m_pos) * fade / dist; bWasWindModifierFound = true; } } -- cgit v1.2.3