From d17c67b3a403b431339b6fedba66246aa7af4583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Thu, 14 Nov 2019 00:28:27 +0100 Subject: [PATCH] Fix unsigned integer properties being returned as signed integers from Lua functions --- src/lua/LuaScriptInterface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 365aee26d..48f4847f6 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -2486,19 +2486,19 @@ void LuaScriptInterface::LuaGetProperty(lua_State* l, StructProperty property, i case StructProperty::TransitionType: case StructProperty::ParticleType: case StructProperty::Integer: - lua_pushinteger(l, *((int*)propertyAddress)); + lua_pushnumber(l, *((int*)propertyAddress)); break; case StructProperty::UInteger: - lua_pushinteger(l, *((unsigned int*)propertyAddress)); + lua_pushnumber(l, *((unsigned int*)propertyAddress)); break; case StructProperty::Float: lua_pushnumber(l, *((float*)propertyAddress)); break; case StructProperty::Char: - lua_pushinteger(l, *((char*)propertyAddress)); + lua_pushnumber(l, *((char*)propertyAddress)); break; case StructProperty::UChar: - lua_pushinteger(l, *((unsigned char*)propertyAddress)); + lua_pushnumber(l, *((unsigned char*)propertyAddress)); break; case StructProperty::BString: {