Fix resetAA to actually remove all AAs except granted AAs (#1681)

This commit is contained in:
Natedog2012 2021-11-06 16:36:19 -05:00 committed by GitHub
parent b983fac860
commit 886f00ed50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -492,7 +492,8 @@ void Client::ResetAA() {
m_pp.raid_leadership_points = 0;
m_pp.group_leadership_exp = 0;
m_pp.raid_leadership_exp = 0;
database.DeleteCharacterAAs(CharacterID());
database.DeleteCharacterLeadershipAAs(CharacterID());
}

View File

@ -1973,7 +1973,7 @@ bool ZoneDatabase::DeleteCharacterLeadershipAAs(uint32 character_id){
}
bool ZoneDatabase::DeleteCharacterAAs(uint32 character_id){
std::string query = StringFormat("DELETE FROM `character_alternate_abilities` WHERE `id` = %u", character_id);
std::string query = StringFormat("DELETE FROM `character_alternate_abilities` WHERE `id` = %u AND `aa_id` NOT IN(SELECT a.first_rank_id FROM aa_ability a WHERE a.grant_only != 0)", character_id);
QueryDatabase(query);
return true;
}