mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-02-04 09:09:09 +00:00
feat(glue): implement character deletion
This commit is contained in:
parent
4e7a4fb87a
commit
98111f2920
12 changed files with 283 additions and 110 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue