From 3e9d030dc4b3f4e490ad8b84a04b4bf1c5a17954 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 23 Oct 2019 18:28:58 +0200 Subject: [PATCH] Automatically recalculate boosted stat after recalculating flat stat --- src/Battling/Models/BattleCreature.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Battling/Models/BattleCreature.cpp b/src/Battling/Models/BattleCreature.cpp index ac1a6c8..4453b94 100644 --- a/src/Battling/Models/BattleCreature.cpp +++ b/src/Battling/Models/BattleCreature.cpp @@ -31,6 +31,7 @@ uint32_t Battling::BattleCreature::GetBoostedStat(Core::Statistic stat) { void Battling::BattleCreature::RecalculateFlatStats() { this->_flatStats = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateFlatStats(this); + RecalculateBoostedStats(); } void Battling::BattleCreature::RecalculateBoostedStats() { this->_boostedStats = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateFlatStats(this); @@ -39,6 +40,7 @@ void Battling::BattleCreature::RecalculateBoostedStats() { void Battling::BattleCreature::RecalculateFlatStat(Core::Statistic stat) { auto s = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateFlatStat(this, stat); this->_flatStats.SetStat(stat, s); + RecalculateBoostedStat(stat); } void Battling::BattleCreature::RecalculateBoostedStat(Core::Statistic stat) {