fix: deleting last character still shows the character (#1123)

* Fix deleting last character

Fix an issue where deleting your last character caused the character to still show up on the character selection screen.

Tested that deleting my final character results in an empty character selection scene.

* Update UserManager.cpp
This commit is contained in:
David Markowitz 2023-09-24 00:55:54 -07:00 committed by GitHub
parent 51540568fb
commit 44f466ac72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,7 +204,6 @@ void UserManager::RequestCharacterList(const SystemAddress& sysAddr) {
stmt->setUInt(1, u->GetAccountID()); stmt->setUInt(1, u->GetAccountID());
sql::ResultSet* res = stmt->executeQuery(); sql::ResultSet* res = stmt->executeQuery();
if (res->rowsCount() > 0) {
std::vector<Character*>& chars = u->GetCharacters(); std::vector<Character*>& chars = u->GetCharacters();
for (size_t i = 0; i < chars.size(); ++i) { for (size_t i = 0; i < chars.size(); ++i) {
@ -238,7 +237,6 @@ void UserManager::RequestCharacterList(const SystemAddress& sysAddr) {
character->SetIsNewLogin(); character->SetIsNewLogin();
chars.push_back(character); chars.push_back(character);
} }
}
delete res; delete res;
delete stmt; delete stmt;