Added getactor/getplace using registry keys.

This commit is contained in:
2021-10-13 20:32:43 -04:00
parent 5b3f3b7ff0
commit 50d62d9bfd
2 changed files with 50 additions and 11 deletions

View File

@@ -153,6 +153,21 @@ LuaDefine(tangible_id, "c") {
return LS.result();
}
LuaDefine(tangible_getactor, "c") {
LuaRet actor;
LuaStack LS(L, actor);
LS.rawget(actor, LuaRegistry, "actor");
return LS.result();
}
LuaDefine(tangible_getplace, "c") {
LuaRet place;
LuaStack LS(L, place);
LS.rawget(place, LuaRegistry, "place");
return LS.result();
}
LuaDefine(world_wait, "f") {
if ((lua_gettop(L) != 1) || (lua_type(L, -1) != LUA_TNUMBER)) {
luaL_error(L, "Argument to wait must be a number.");