summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-12-10 15:50:55 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-12-10 15:50:55 (GMT)
commit799091f0049fb48e19430c861156feba125a7166 (patch)
treeba7c489c754ad199259771238fdae803aaced5d6 /src
parentffb4c1c5a88534bd1ccb0b33acda6b8837d76b14 (diff)
downloadpowder-799091f0049fb48e19430c861156feba125a7166.zip
powder-799091f0049fb48e19430c861156feba125a7166.tar.gz
Allow both BrE and AmE spellings of colour with Lua
Diffstat (limited to 'src')
-rw-r--r--src/luaconsole.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c
index 0f16bda..e776304 100644
--- a/src/luaconsole.c
+++ b/src/luaconsole.c
@@ -330,6 +330,9 @@ int luacon_particle_getproperty(char * key, int * format)
} else if (strcmp(key, "dcolour")==0){
offset = offsetof(particle, dcolour);
*format = 0;
+ } else if (strcmp(key, "dcolor")==0){
+ offset = offsetof(particle, dcolour);
+ *format = 0;
} else {
offset = -1;
}
@@ -440,6 +443,10 @@ int luacon_element_getproperty(char * key, int * format)
offset = offsetof(part_type, pcolors);
*format = 0;
}
+ if (strcmp(key, "colour")==0){
+ offset = offsetof(part_type, pcolors);
+ *format = 0;
+ }
else if (strcmp(key, "advection")==0){
offset = offsetof(part_type, advection);
*format = 1;
@@ -1036,6 +1043,7 @@ int luatpt_set_property(lua_State* l)
h = abs(luaL_optint(l, 6, -1));
else
h = -1;
+ //TODO: Use particle_getproperty
if (strcmp(prop,"type")==0){
offset = offsetof(particle, type);
format = 3;
@@ -1177,6 +1185,7 @@ int luatpt_get_property(lua_State* l)
return luaL_error(l, "Invalid particle ID '%d'", i);
if (parts[i].type)
{
+ //TODO: Use particle_getproperty
if (strcmp(prop,"type")==0){
lua_pushinteger(l, parts[i].type);
return 1;