feat(glue): implement character deletion

This commit is contained in:
VDm 2025-04-06 16:16:43 +04:00
parent 4e7a4fb87a
commit 98111f2920
12 changed files with 283 additions and 110 deletions

View file

@ -122,7 +122,15 @@ int32_t Script_SelectCharacter(lua_State* L) {
}
int32_t Script_DeleteCharacter(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
if (!lua_isnumber(L, 1)) {
luaL_error(L, "Usage: DeleteCharacter(index)");
}
int32_t index = static_cast<int32_t>(lua_tonumber(L, 1)) - 1;
if (index >= 0 && index < CCharacterSelection::GetNumCharacters()) {
CGlueMgr::DeleteCharacter(CCharacterSelection::s_characterList[index].m_characterInfo.guid);
}
return 0;
}
int32_t Script_RenameCharacter(lua_State* L) {