summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-07-10 12:44:09 +0200
committerGitHub <noreply@github.com>2016-07-10 12:44:09 +0200
commit443b657b7d887ef443bc0de5472519f782b1cbd2 (patch)
tree2dccada9068fa3fae2e9d19b1cdaa56f0047606b /src
parentremoved cast from BlockTrapdoor.h (#3256) (diff)
parentFixed Lua Json serializing a bool. (diff)
downloadcuberite-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')
-rw-r--r--src/Bindings/LuaJson.cpp10
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;