diff options
author | Mattes D <github@xoft.cz> | 2016-07-10 12:44:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-10 12:44:09 +0200 |
commit | 443b657b7d887ef443bc0de5472519f782b1cbd2 (patch) | |
tree | 2dccada9068fa3fae2e9d19b1cdaa56f0047606b /src/Bindings/LuaJson.cpp | |
parent | removed cast from BlockTrapdoor.h (#3256) (diff) | |
parent | Fixed Lua Json serializing a bool. (diff) | |
download | cuberite-443b657b7d887ef443bc0de5472519f782b1cbd2.tar cuberite-443b657b7d887ef443bc0de5472519f782b1cbd2.tar.gz cuberite-443b657b7d887ef443bc0de5472519f782b1cbd2.tar.bz2 cuberite-443b657b7d887ef443bc0de5472519f782b1cbd2.tar.lz cuberite-443b657b7d887ef443bc0de5472519f782b1cbd2.tar.xz cuberite-443b657b7d887ef443bc0de5472519f782b1cbd2.tar.zst cuberite-443b657b7d887ef443bc0de5472519f782b1cbd2.zip |
Diffstat (limited to 'src/Bindings/LuaJson.cpp')
-rw-r--r-- | src/Bindings/LuaJson.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Bindings/LuaJson.cpp b/src/Bindings/LuaJson.cpp index 4fa16273c..39a720319 100644 --- a/src/Bindings/LuaJson.cpp +++ b/src/Bindings/LuaJson.cpp @@ -160,6 +160,16 @@ static Json::Value JsonSerializeValue(cLuaState & a_LuaState) { switch (lua_type(a_LuaState, -1)) { + case LUA_TBOOLEAN: + { + bool v; + a_LuaState.GetStackValue(-1, v); + return Json::Value(v); + } + case LUA_TNIL: + { + return Json::Value(Json::nullValue); + } case LUA_TNUMBER: { lua_Number v; |