aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/lua/ULuaParty.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Lua/src/lua/ULuaParty.pas8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lua/src/lua/ULuaParty.pas b/Lua/src/lua/ULuaParty.pas
index 41a0d2ae..25cfce94 100644
--- a/Lua/src/lua/ULuaParty.pas
+++ b/Lua/src/lua/ULuaParty.pas
@@ -101,14 +101,13 @@ function ULuaParty_Register(L: Plua_State): Integer; cdecl;
var
Info: TParty_ModeInfo;
Key: String;
+ P: TLuaPlugin;
begin
// check for table on stack
luaL_checkType(L, 1, LUA_TTABLE);
// get parent id
- lua_getfield (L, LUA_REGISTRYINDEX, '_USDX_STATE_ID');
- if (not lua_isNumber(L, -1)) then
- luaL_error(L, 'unable to get _USDX_STATE_ID in ULuaParty_Register');
+ P := Lua_GetOwner(L);
// set mode info to default
@@ -116,8 +115,7 @@ begin
// set parent in info rec and pop it from stack
- Info.Parent := lua_toInteger(L, -1);
- lua_pop(L, 1);
+ Info.Parent := P.Id;
// go through table elements
lua_pushNil(L);