From b850abe347f4db35c694eec253c510a869db20f1 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sat, 4 Jun 2011 12:10:14 +0100 Subject: [PATCH] Fix setting of temp, x and y particle properties --- src/luaconsole.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/luaconsole.c b/src/luaconsole.c index 26978fa54..351ab93f7 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -349,7 +349,7 @@ int luatpt_set_property(lua_State* l) format = 3; } else if (strcmp(prop,"temp")==0){ offset = offsetof(particle, temp); - format = 1; + format = 2; } else if (strcmp(prop,"tmp")==0){ offset = offsetof(particle, tmp); format = 1; @@ -361,10 +361,10 @@ int luatpt_set_property(lua_State* l) format = 2; } else if (strcmp(prop,"x")==0){ offset = offsetof(particle, x); - format = 1; + format = 2; } else if (strcmp(prop,"y")==0){ offset = offsetof(particle, y); - format = 1; + format = 2; } else { lua_pushstring(l, "invalid property"); lua_error(l); @@ -452,7 +452,7 @@ int luatpt_get_property(lua_State* l) return 1; } if (strcmp(prop,"temp")==0){ - lua_pushinteger(l, parts[i].temp); + lua_pushnumber(l, parts[i].temp); return 1; } if (strcmp(prop,"tmp")==0){ @@ -468,11 +468,11 @@ int luatpt_get_property(lua_State* l) return 1; } if (strcmp(prop,"x")==0){ - lua_pushinteger(l, parts[i].x); + lua_pushnumber(l, parts[i].x); return 1; } if (strcmp(prop,"y")==0){ - lua_pushinteger(l, parts[i].y); + lua_pushnumber(l, parts[i].y); return 1; } }