summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2015-02-23 15:29:07 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2015-02-23 15:29:07 +0100
commit8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a (patch)
treec6a1a6b35d451f67b44dc68e0fe341403dbf132e /src/Bindings/ManualBindings.cpp
parentDocumented cStringCompression (diff)
downloadcuberite-8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a.tar
cuberite-8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a.tar.gz
cuberite-8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a.tar.bz2
cuberite-8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a.tar.lz
cuberite-8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a.tar.xz
cuberite-8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a.tar.zst
cuberite-8c8ec1094d8ba6df410f1fb0d0fba216b98a8f9a.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/ManualBindings.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 451161d87..7255f73a4 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -115,10 +115,10 @@ static int tolua_CompressStringZLIB(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1) ||
+ !S.CheckParamString(1) &&
(
- !lua_isnumber(tolua_S, 2) &&
- !lua_isnil(tolua_S, 2)
+ !S.CheckParamNumber(2) ||
+ !S.CheckParamEnd(2)
)
)
{
@@ -146,8 +146,8 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1) ||
- !lua_isnumber(tolua_S, 2)
+ !S.CheckParamString(1) &&
+ !S.CheckParamNumber(2)
)
{
cLuaState::LogStackTrace(tolua_S);
@@ -173,7 +173,10 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
static int tolua_CompressStringGZIP(lua_State * tolua_S)
{
cLuaState S(tolua_S);
- if (!lua_isstring(tolua_S, 1))
+ if (
+ !S.CheckParamString(1) &&
+ !S.CheckParamEnd(2)
+ )
{
cLuaState::LogStackTrace(tolua_S);
return 0;
@@ -198,15 +201,14 @@ static int tolua_UncompressStringGZIP(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1)
+ !S.CheckParamString(1) &&
+ !S.CheckParamEnd(2)
)
{
cLuaState::LogStackTrace(tolua_S);
return 0;
}
-
-
// Get the params:
AString ToUncompress;
S.GetStackValues(1, ToUncompress);
@@ -226,15 +228,14 @@ static int tolua_InflateString(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
- !lua_isstring(tolua_S, 1)
+ !S.CheckParamString(1) &&
+ !S.CheckParamEnd(2)
)
{
cLuaState::LogStackTrace(tolua_S);
return 0;
}
-
-
// Get the params:
AString ToUncompress;
S.GetStackValues(1, ToUncompress);