From e86d11250b49ac3eb644be003d8d4427ec035c5c Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 7 Aug 2016 14:32:30 -0400 Subject: [PATCH] Actually remove expendable AAs from the DB --- zone/aa.cpp | 4 ++++ zone/client.cpp | 5 +++++ zone/client.h | 1 + 3 files changed, 10 insertions(+) diff --git a/zone/aa.cpp b/zone/aa.cpp index f6facec8c..1640a9eff 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1240,6 +1240,10 @@ void Mob::ExpendAlternateAdvancementCharge(uint32 aa_id) { CastToClient()->GetEPP().expended_aa += r->cost; } } + if (IsClient()) { + auto c = CastToClient(); + c->RemoveExpendedAA(ability->first_rank_id); + } aa_ranks.erase(iter.first); } diff --git a/zone/client.cpp b/zone/client.cpp index eebe204ee..11799fb9e 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -568,6 +568,11 @@ bool Client::SaveAA() { return true; } +void Client::RemoveExpendedAA(int aa_id) +{ + database.QueryDatabase(StringFormat("DELETE from `character_alternate_abilities` WHERE `id` = %d and `aa_id` = %d", character_id, aa_id)); +} + bool Client::Save(uint8 iCommitNow) { if(!ClientDataLoaded()) return false; diff --git a/zone/client.h b/zone/client.h index 3bd2b29c5..819d6ed17 100644 --- a/zone/client.h +++ b/zone/client.h @@ -328,6 +328,7 @@ public: /* New PP Save Functions */ bool SaveCurrency(){ return database.SaveCharacterCurrency(this->CharacterID(), &m_pp); } bool SaveAA(); + void RemoveExpendedAA(int aa_id); inline bool ClientDataLoaded() const { return client_data_loaded; } inline bool Connected() const { return (client_state == CLIENT_CONNECTED); }