summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-03 17:49:21 +0200
committermadmaxoft <github@xoft.cz>2014-07-03 17:49:21 +0200
commit2dbed03cbce873d8a6582bfdc5c4b826b6e7eade (patch)
treec95173c315bbd1020301188b138d426fa800b5d2 /src/Bindings/LuaState.cpp
parentCMake: Changed slash format to support MSYS. (diff)
downloadcuberite-2dbed03cbce873d8a6582bfdc5c4b826b6e7eade.tar
cuberite-2dbed03cbce873d8a6582bfdc5c4b826b6e7eade.tar.gz
cuberite-2dbed03cbce873d8a6582bfdc5c4b826b6e7eade.tar.bz2
cuberite-2dbed03cbce873d8a6582bfdc5c4b826b6e7eade.tar.lz
cuberite-2dbed03cbce873d8a6582bfdc5c4b826b6e7eade.tar.xz
cuberite-2dbed03cbce873d8a6582bfdc5c4b826b6e7eade.tar.zst
cuberite-2dbed03cbce873d8a6582bfdc5c4b826b6e7eade.zip
Diffstat (limited to 'src/Bindings/LuaState.cpp')
-rw-r--r--src/Bindings/LuaState.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 7a5ed1425..32638df96 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -811,6 +811,18 @@ void cLuaState::GetStackValue(int a_StackPos, double & a_ReturnedVal)
+void cLuaState::GetStackValue(int a_StackPos, eWeather & a_ReturnedVal)
+{
+ if (lua_isnumber(m_LuaState, a_StackPos))
+ {
+ a_ReturnedVal = (eWeather)Clamp((int)tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal), (int)wSunny, (int)wThunderstorm);
+ }
+}
+
+
+
+
+
bool cLuaState::CallFunction(int a_NumResults)
{
ASSERT (m_NumCurrentFunctionArgs >= 0); // A function must be pushed to stack first