This commit is contained in:
2025-09-20 23:14:17 +03:00
parent e967844558
commit fea7c71788
18 changed files with 158 additions and 15 deletions

View File

@@ -399,6 +399,20 @@ LuaData::LuaData()
return 0;
});
lua_setglobal(L, "ecs_character_physics_control");
lua_pushcfunction(L, [](lua_State *L) -> int {
OgreAssert(lua_gettop(L) == 3, "Bad parameters");
luaL_checktype(L, 1, LUA_TNUMBER); // parent
luaL_checktype(L, 2, LUA_TNUMBER); // object
luaL_checktype(L, 3, LUA_TSTRING); // slot
int parent = lua_tointeger(L, 1);
int object = lua_tointeger(L, 2);
Ogre::String slot = lua_tostring(L, 3);
flecs::entity parent_e = idmap.get_entity(parent);
flecs::entity object_e = idmap.get_entity(object);
object_e.set<CharacterSlot>({ parent_e, slot, false });
return 0;
});
lua_setglobal(L, "ecs_set_slot");
}
LuaData::~LuaData()