Fix setting of temp, x and y particle properties

This commit is contained in:
Simon Robertshaw 2011-06-04 12:10:14 +01:00
parent af5e2b2488
commit b850abe347

View File

@ -349,7 +349,7 @@ int luatpt_set_property(lua_State* l)
format = 3; format = 3;
} else if (strcmp(prop,"temp")==0){ } else if (strcmp(prop,"temp")==0){
offset = offsetof(particle, temp); offset = offsetof(particle, temp);
format = 1; format = 2;
} else if (strcmp(prop,"tmp")==0){ } else if (strcmp(prop,"tmp")==0){
offset = offsetof(particle, tmp); offset = offsetof(particle, tmp);
format = 1; format = 1;
@ -361,10 +361,10 @@ int luatpt_set_property(lua_State* l)
format = 2; format = 2;
} else if (strcmp(prop,"x")==0){ } else if (strcmp(prop,"x")==0){
offset = offsetof(particle, x); offset = offsetof(particle, x);
format = 1; format = 2;
} else if (strcmp(prop,"y")==0){ } else if (strcmp(prop,"y")==0){
offset = offsetof(particle, y); offset = offsetof(particle, y);
format = 1; format = 2;
} else { } else {
lua_pushstring(l, "invalid property"); lua_pushstring(l, "invalid property");
lua_error(l); lua_error(l);
@ -452,7 +452,7 @@ int luatpt_get_property(lua_State* l)
return 1; return 1;
} }
if (strcmp(prop,"temp")==0){ if (strcmp(prop,"temp")==0){
lua_pushinteger(l, parts[i].temp); lua_pushnumber(l, parts[i].temp);
return 1; return 1;
} }
if (strcmp(prop,"tmp")==0){ if (strcmp(prop,"tmp")==0){
@ -468,11 +468,11 @@ int luatpt_get_property(lua_State* l)
return 1; return 1;
} }
if (strcmp(prop,"x")==0){ if (strcmp(prop,"x")==0){
lua_pushinteger(l, parts[i].x); lua_pushnumber(l, parts[i].x);
return 1; return 1;
} }
if (strcmp(prop,"y")==0){ if (strcmp(prop,"y")==0){
lua_pushinteger(l, parts[i].y); lua_pushnumber(l, parts[i].y);
return 1; return 1;
} }
} }