mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Cleanup] Identical conditions right beside each other in aa.cpp (#3213)
# Notes - These conditions were identical and could be consolidated.
This commit is contained in:
parent
1bafe0b6b3
commit
89b3a04eb3
17
zone/aa.cpp
17
zone/aa.cpp
@ -1398,27 +1398,28 @@ int Mob::GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in) {
|
||||
|
||||
void Mob::ExpendAlternateAdvancementCharge(uint32 aa_id) {
|
||||
for (auto &iter : aa_ranks) {
|
||||
AA::Ability *ability = zone->GetAlternateAdvancementAbility(iter.first);
|
||||
auto ability = zone->GetAlternateAdvancementAbility(iter.first);
|
||||
if (ability && aa_id == ability->id) {
|
||||
if (iter.second.second > 0) {
|
||||
iter.second.second -= 1;
|
||||
|
||||
if (iter.second.second == 0) {
|
||||
if (IsClient()) {
|
||||
AA::Rank *r = ability->GetRankByPointsSpent(iter.second.first);
|
||||
if (r) {
|
||||
CastToClient()->GetEPP().expended_aa += r->cost;
|
||||
}
|
||||
}
|
||||
if (IsClient()) {
|
||||
auto c = CastToClient();
|
||||
|
||||
auto r = ability->GetRankByPointsSpent(iter.second.first);
|
||||
if (r) {
|
||||
c->GetEPP().expended_aa += r->cost;
|
||||
}
|
||||
|
||||
c->RemoveExpendedAA(ability->first_rank_id);
|
||||
}
|
||||
|
||||
aa_ranks.erase(iter.first);
|
||||
}
|
||||
|
||||
if (IsClient()) {
|
||||
Client *c = CastToClient();
|
||||
auto c = CastToClient();
|
||||
c->SaveAA();
|
||||
c->SendAlternateAdvancementPoints();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user