Remove action subtable, fix bug in makeclass

This commit is contained in:
2021-12-28 13:56:16 -05:00
parent 154ee737c6
commit 2e543984e6
7 changed files with 13 additions and 56 deletions

View File

@@ -542,8 +542,8 @@ void World::invoke_plan(int64_t actor_id, int64_t place_id, const std::string &a
// Set up for Lua manipulation.
lua_State *L = state();
LuaVar actor, place, func, tangibles, mt, index, actions, thread, threads, thinfo, message, invdata;
LuaStack LS(L, actor, place, func, tangibles, mt, index, actions, thread, threads, thinfo, message, invdata);
LuaVar actor, place, func, tangibles, mt, index, thread, threads, thinfo, message, invdata;
LuaStack LS(L, actor, place, func, tangibles, mt, index, thread, threads, thinfo, message, invdata);
// Get the actor and place.
LS.rawget(tangibles, LuaRegistry, "tangibles");
@@ -565,12 +565,7 @@ void World::invoke_plan(int64_t actor_id, int64_t place_id, const std::string &a
LS.result();
return;
}
LS.rawget(actions, index, "action");
if (!LS.istable(actions)) {
LS.result();
return;
}
LS.rawget(func, actions, action);
LS.rawget(func, index, action);
if (!LS.isfunction(func)) {
LS.result();
return;