changeset 2220:0fb6e0461105

fix handling of Booleans in Lua
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Dec 2016 11:43:35 +0100
parents 262fcab24024
children e7beca979562
files Core/Lua/LuaContext.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Lua/LuaContext.cpp	Tue Dec 13 11:06:41 2016 +0100
+++ b/Core/Lua/LuaContext.cpp	Tue Dec 13 11:43:35 2016 +0100
@@ -497,6 +497,10 @@
       // Lua can convert most types to strings by default.
       result = std::string(lua_tostring(lua_, top));
     }
+    else if (lua_isboolean(lua_, top))
+    {
+      result = lua_toboolean(lua_, top) ? true : false;
+    }
     else
     {
       LOG(WARNING) << "Unsupported Lua type when returning Json";