summaryrefslogtreecommitdiff
path: root/src/cat/LuaScriptInterface.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-03-16 17:23:19 (GMT)
committer jacob1 <jfu614@gmail.com>2013-03-16 17:23:19 (GMT)
commit3a738846a3e0c59ed02805f11f93678ae42a946e (patch)
tree72cf0fc51fbde58f3d7e6bb1601572a4f20236c0 /src/cat/LuaScriptInterface.cpp
parentd76650f7e6983bb11e6217661b143f2efe3791f6 (diff)
downloadpowder-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.cpp7
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);
+ }
}
}
}