diff options
| author | jacob1 <jfu614@gmail.com> | 2013-03-16 17:23:19 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-03-16 17:23:19 (GMT) |
| commit | 3a738846a3e0c59ed02805f11f93678ae42a946e (patch) | |
| tree | 72cf0fc51fbde58f3d7e6bb1601572a4f20236c0 /src/cat/LuaScriptInterface.cpp | |
| parent | d76650f7e6983bb11e6217661b143f2efe3791f6 (diff) | |
| download | powder-3a738846a3e0c59ed02805f11f93678ae42a946e.zip powder-3a738846a3e0c59ed02805f11f93678ae42a946e.tar.gz | |
add identifier constants based on the display name to the lua api
Diffstat (limited to 'src/cat/LuaScriptInterface.cpp')
| -rw-r--r-- | src/cat/LuaScriptInterface.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index 33e10d2..79c79a1 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -1141,6 +1141,13 @@ void LuaScriptInterface::initElementsAPI() { lua_pushinteger(l, i); lua_setfield(l, elementsAPI, luacon_sim->elements[i].Identifier); + char realIdentifier[20]; + sprintf(realIdentifier, "DEFAULT_PT_%s", luacon_sim->elements[i].Name); + if (i != 0 && i != PT_NBHL && i != PT_NWHL && strcmp(luacon_sim->elements[i].Identifier, realIdentifier)) + { + lua_pushinteger(l, i); + lua_setfield(l, elementsAPI, realIdentifier); + } } } } |
