diff options
author | Alexander Harkness <me@bearbin.net> | 2018-01-14 19:44:45 +0100 |
---|---|---|
committer | peterbell10 <peterbell10@live.co.uk> | 2018-01-14 19:44:45 +0100 |
commit | ad22922393c7982b885840960222de64ff96ad36 (patch) | |
tree | a028b7459f3c865f7e8bd563ae476c578763a9b1 /src/Bindings | |
parent | Travis: Remove gdb (#4140) (diff) | |
download | cuberite-ad22922393c7982b885840960222de64ff96ad36.tar cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.gz cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.bz2 cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.lz cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.xz cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.zst cuberite-ad22922393c7982b885840960222de64ff96ad36.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 56 |
1 files changed, 52 insertions, 4 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 4e7d7c8ef..fbb49d127 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -3954,6 +3954,56 @@ static int tolua_cCompositeChat_UnderlineUrls(lua_State * tolua_S) +static int tolua_cEntity_IsSubmerged(lua_State * tolua_S) +{ + // Check the params: + cLuaState L(tolua_S); + if (!L.CheckParamSelf("cEntity")) + { + return 0; + } + + // Get the params: + cEntity * self = nullptr; + L.GetStackValue(1, self); + + // API function deprecated: + LOGWARNING("cEntity:IsSubmerged() is deprecated. Use cEntity:IsHeadInWater() instead."); + cLuaState::LogStackTrace(tolua_S); + + L.Push(self->IsHeadInWater()); + return 1; +} + + + + + +static int tolua_cEntity_IsSwimming(lua_State * tolua_S) +{ + // Check the params: + cLuaState L(tolua_S); + if (!L.CheckParamSelf("cEntity")) + { + return 0; + } + + // Get the params: + cEntity * self = nullptr; + L.GetStackValue(1, self); + + // API function deprecated + LOGWARNING("cEntity:IsSwimming() is deprecated. Use cEntity:IsInWater() instead."); + cLuaState::LogStackTrace(tolua_S); + + L.Push(self->IsInWater()); + return 1; +} + + + + + static int tolua_cEntity_GetPosition(lua_State * tolua_S) { cLuaState L(tolua_S); @@ -4073,6 +4123,8 @@ void cManualBindings::Bind(lua_State * tolua_S) tolua_beginmodule(tolua_S, "cEntity"); tolua_constant(tolua_S, "INVALID_ID", cEntity::INVALID_ID); + tolua_function(tolua_S, "IsSubmerged", tolua_cEntity_IsSubmerged); + tolua_function(tolua_S, "IsSwimming", tolua_cEntity_IsSwimming); tolua_function(tolua_S, "GetPosition", tolua_cEntity_GetPosition); tolua_function(tolua_S, "GetSpeed", tolua_cEntity_GetSpeed); tolua_endmodule(tolua_S); @@ -4238,7 +4290,3 @@ void cManualBindings::Bind(lua_State * tolua_S) tolua_endmodule(tolua_S); } - - - - |