Much better narration/dialogue/action handling (and for lua too)

This commit is contained in:
2026-01-23 02:42:29 +03:00
parent cd91174f5d
commit 1d358d206e
7 changed files with 220 additions and 28 deletions

View File

@@ -302,7 +302,10 @@ LuaData::LuaData()
lua_setglobal(L, "setup_handler");
lua_pushcfunction(L, [](lua_State *L) -> int {
luaL_checktype(L, 1, LUA_TSTRING);
luaL_checktype(L, 2, LUA_TFUNCTION);
if (lua_type(L, 2) == LUA_TFUNCTION)
luaL_checktype(L, 2, LUA_TFUNCTION);
else
luaL_checktype(L, 2, LUA_TTABLE);
ECS::get_mut<PlayerActionModule>().setupLuaActionHandler(L);
ECS::modified<PlayerActionModule>();
return 0;