From 076c5ee2234c7f217f8941bbbd710d317485ccbc Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Tue, 7 Oct 2014 17:01:07 +1000 Subject: Various uninitialised variable fixes sky.cpp: m_bgcolor.getAlpha() was being used before initialised mesh related: m_highlight_mesh_color was being used uninitialised --- src/sky.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/sky.h') diff --git a/src/sky.h b/src/sky.h index d7dabedb8..4af6be024 100644 --- a/src/sky.h +++ b/src/sky.h @@ -79,7 +79,8 @@ private: { if (!m_sunlight_seen) return 0; - float x; m_time_of_day >= 0.5 ? x = (1 - m_time_of_day) * 2 : x = m_time_of_day * 2; + float x = m_time_of_day >= 0.5 ? (1 - m_time_of_day) * 2 : m_time_of_day * 2; + if (x <= 0.3) return 0; if (x <= 0.4) // when the sun and moon are aligned -- cgit v1.2.3