From dcea29ec306b9684604946ee348b59d20af7acb2 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 4 Oct 2013 08:38:38 +0200 Subject: Added cWorld::IsWeatherXXX() functions --- source/World.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/World.h') diff --git a/source/World.h b/source/World.h index dd856fc72..dcb197bd0 100644 --- a/source/World.h +++ b/source/World.h @@ -554,8 +554,16 @@ public: /// Forces a weather change in the next game tick void ChangeWeather (void); - /// Returns the current weather + /// Returns the current weather. Instead of comparing values directly to the weather constants, use IsWeatherXXX() functions, if possible eWeather GetWeather (void) const { return m_Weather; }; + + bool IsWeatherSunny(void) const { return (m_Weather == wSunny); } + bool IsWeatherRain (void) const { return (m_Weather == wRain); } + bool IsWeatherStorm(void) const { return (m_Weather == wStorm); } + + /// Returns true if the current weather has any precipitation - rain or storm + bool IsWeatherWet (void) const { return (m_Weather != wSunny); } + // tolua_end cChunkGenerator & GetGenerator(void) { return m_Generator; } -- cgit v1.2.3