diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-12-01 14:43:03 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-12-01 14:43:03 +0100 |
commit | 677dde51bd3a8028dc28b004293b7c1b424ead0a (patch) | |
tree | 23e6e8357a96e0d3920ef00a9c15061f965d822e /src/Bindings/DeprecatedBindings.cpp | |
parent | Merge branch 'master' into MobSpawner (diff) | |
parent | Merge pull request #1624 from mc-server/LuaDeprecating (diff) | |
download | cuberite-677dde51bd3a8028dc28b004293b7c1b424ead0a.tar cuberite-677dde51bd3a8028dc28b004293b7c1b424ead0a.tar.gz cuberite-677dde51bd3a8028dc28b004293b7c1b424ead0a.tar.bz2 cuberite-677dde51bd3a8028dc28b004293b7c1b424ead0a.tar.lz cuberite-677dde51bd3a8028dc28b004293b7c1b424ead0a.tar.xz cuberite-677dde51bd3a8028dc28b004293b7c1b424ead0a.tar.zst cuberite-677dde51bd3a8028dc28b004293b7c1b424ead0a.zip |
Diffstat (limited to 'src/Bindings/DeprecatedBindings.cpp')
-rw-r--r-- | src/Bindings/DeprecatedBindings.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Bindings/DeprecatedBindings.cpp b/src/Bindings/DeprecatedBindings.cpp index 345ab2a07..0b2539fde 100644 --- a/src/Bindings/DeprecatedBindings.cpp +++ b/src/Bindings/DeprecatedBindings.cpp @@ -225,6 +225,42 @@ static int tolua_get_AllToLua_g_BlockFullyOccupiesVoxel(lua_State* tolua_S) +/* function: StringToMobType */ +static int tolua_AllToLua_StringToMobType00(lua_State* tolua_S) +{ + cLuaState LuaState(tolua_S); + + #ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_iscppstring(tolua_S,1,0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else + #endif + { + const AString a_MobString = tolua_tocppstring(LuaState, 1, 0); + eMonsterType MobType = cMonster::StringToMobType(a_MobString); + tolua_pushnumber(LuaState, (lua_Number) MobType); + tolua_pushcppstring(LuaState, (const char *) a_MobString); + } + + LOGWARNING("Warning in function call 'StringToMobType': StringToMobType() is deprecated. Please use cMonster:StringToMobType()"); + LuaState.LogStackTrace(0); + return 2; + + #ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(LuaState, "#ferror in function 'StringToMobType'.", &tolua_err); + return 0; + #endif +} + + + + + /** function: cWorld:SetSignLines */ static int tolua_cWorld_SetSignLines(lua_State * tolua_S) { @@ -296,6 +332,8 @@ void DeprecatedBindings::Bind(lua_State * tolua_S) tolua_array(tolua_S, "g_BlockIsSolid", tolua_get_AllToLua_g_BlockIsSolid, nullptr); tolua_array(tolua_S, "g_BlockFullyOccupiesVoxel", tolua_get_AllToLua_g_BlockFullyOccupiesVoxel, nullptr); + tolua_function(tolua_S, "StringToMobType", tolua_AllToLua_StringToMobType00); + tolua_beginmodule(tolua_S, "cWorld"); tolua_function(tolua_S, "UpdateSign", tolua_cWorld_SetSignLines); tolua_endmodule(tolua_S); |