summaryrefslogtreecommitdiffstats
path: root/source/World.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-04 08:38:38 +0200
committermadmaxoft <github@xoft.cz>2013-10-04 08:38:38 +0200
commitdcea29ec306b9684604946ee348b59d20af7acb2 (patch)
tree515ddffdf5853083e376283477f71385f5e2330b /source/World.h
parentMerge branch 'master' of git://github.com/SamJBarney/MCServer into SamJBarney-master (diff)
downloadcuberite-dcea29ec306b9684604946ee348b59d20af7acb2.tar
cuberite-dcea29ec306b9684604946ee348b59d20af7acb2.tar.gz
cuberite-dcea29ec306b9684604946ee348b59d20af7acb2.tar.bz2
cuberite-dcea29ec306b9684604946ee348b59d20af7acb2.tar.lz
cuberite-dcea29ec306b9684604946ee348b59d20af7acb2.tar.xz
cuberite-dcea29ec306b9684604946ee348b59d20af7acb2.tar.zst
cuberite-dcea29ec306b9684604946ee348b59d20af7acb2.zip
Diffstat (limited to '')
-rw-r--r--source/World.h10
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; }