diff options
author | madmaxoft <github@xoft.cz> | 2013-10-06 15:44:14 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-06 15:44:14 +0200 |
commit | dabbf24f587d6c946b84620fb6a86e9b587a23b8 (patch) | |
tree | 7615b6f1c6030b15a67528e84d9740639adbd344 /source/World.h | |
parent | Removed remnants of the old webserver. (diff) | |
parent | APIDump: Brought cItem docs up-to-date. (diff) | |
download | cuberite-dabbf24f587d6c946b84620fb6a86e9b587a23b8.tar cuberite-dabbf24f587d6c946b84620fb6a86e9b587a23b8.tar.gz cuberite-dabbf24f587d6c946b84620fb6a86e9b587a23b8.tar.bz2 cuberite-dabbf24f587d6c946b84620fb6a86e9b587a23b8.tar.lz cuberite-dabbf24f587d6c946b84620fb6a86e9b587a23b8.tar.xz cuberite-dabbf24f587d6c946b84620fb6a86e9b587a23b8.tar.zst cuberite-dabbf24f587d6c946b84620fb6a86e9b587a23b8.zip |
Diffstat (limited to 'source/World.h')
-rw-r--r-- | source/World.h | 10 |
1 files changed, 9 insertions, 1 deletions
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; }
|