summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-05 18:39:18 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-05 18:39:18 +0200
commit5f04488a97b5cdd705368937d977827ef4465d4a (patch)
tree139c7e4505715124b6eee26a3c08f6339bab1eb4 /src/Bindings
parentAdded api documentation for Clamp() (diff)
downloadcuberite-5f04488a97b5cdd705368937d977827ef4465d4a.tar
cuberite-5f04488a97b5cdd705368937d977827ef4465d4a.tar.gz
cuberite-5f04488a97b5cdd705368937d977827ef4465d4a.tar.bz2
cuberite-5f04488a97b5cdd705368937d977827ef4465d4a.tar.lz
cuberite-5f04488a97b5cdd705368937d977827ef4465d4a.tar.xz
cuberite-5f04488a97b5cdd705368937d977827ef4465d4a.tar.zst
cuberite-5f04488a97b5cdd705368937d977827ef4465d4a.zip
Diffstat (limited to 'src/Bindings')
-rw-r--r--src/Bindings/ManualBindings.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 81065a7e1..9ba1501c5 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -96,11 +96,11 @@ static int tolua_Clamp(lua_State * tolua_S)
return lua_do_error(LuaState, "Error in function call '#funcname#': Expected a number for parameters #1, #2 and #3");
}
- int Number = (int)tolua_tonumber(LuaState, 1, 0);
- int Min = (int)tolua_tonumber(LuaState, 2, 0);
- int Max = (int)tolua_tonumber(LuaState, 3, 0);
+ lua_Number Number = tolua_tonumber(LuaState, 1, 0);
+ lua_Number Min = tolua_tonumber(LuaState, 2, 0);
+ lua_Number Max = tolua_tonumber(LuaState, 3, 0);
- int Result = std::min(std::max(Min, Number), Max);
+ lua_Number Result = Clamp(Number, Min, Max);
LuaState.Push(Result);
return 1;
}