From e846734ffbc525dc5cad8f443f4c46c1c921d0e7 Mon Sep 17 00:00:00 2001 From: toxa Date: Sun, 6 Dec 2020 01:21:02 +0300 Subject: [PATCH] IPC did not worked with floating point values --- common/lua_buffers.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lua_buffers.pas b/common/lua_buffers.pas index 30ec83c..c1ff55d 100644 --- a/common/lua_buffers.pas +++ b/common/lua_buffers.pas @@ -183,11 +183,11 @@ procedure stack2buf(astate: Lua_State; aindex: longint; acodec: tLuaCodec); acodec.write(LUA_TBOOLEAN, @tmpb, sizeof(tmpb)); end; LUA_TNUMBER : if lua_isinteger(astate, aindex) then begin - tmpd:= lua_tonumber(astate, aindex); - acodec.write(LUA_TNUMBER, @tmpd, sizeof(tmpd)); - end else begin tmpi:= lua_tointeger(astate, aindex); acodec.write(LUA_TINTEGER, @tmpi, sizeof(tmpi)); + end else begin + tmpd:= lua_tonumber(astate, aindex); + acodec.write(LUA_TNUMBER, @tmpd, sizeof(tmpd)); end; LUA_TSTRING : begin tmps:= lua_tolstring(astate, aindex, len);