diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-06-04 11:10:14 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-06-04 11:10:14 (GMT) |
| commit | b850abe347f4db35c694eec253c510a869db20f1 (patch) | |
| tree | 7b50b14600e6728c4701ccc7c0fb3333c52b67ea /src | |
| parent | af5e2b2488518e92548df434a39d37bf2fb022d6 (diff) | |
| download | powder-b850abe347f4db35c694eec253c510a869db20f1.zip powder-b850abe347f4db35c694eec253c510a869db20f1.tar.gz | |
Fix setting of temp, x and y particle properties
Diffstat (limited to 'src')
| -rw-r--r-- | src/luaconsole.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c index 26978fa..351ab93 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; } } |
