From d86936f6f547e8fdfb08c7ea73e5b25b01ab958f Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Mon, 20 Jan 2025 06:34:38 +0100 Subject: [PATCH] Setup/ItemStats * fixed array structure when converting equal amounts of SPELL_DAMAGE and SPELL_HEALING to SPELL_POWER --- includes/stats.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/stats.class.php b/includes/stats.class.php index 827184a1..6e003dd0 100644 --- a/includes/stats.class.php +++ b/includes/stats.class.php @@ -418,12 +418,12 @@ class StatsContainer $this->fromEnchantment($relE); else foreach ($this->convertSpellEffect($aura, $mVal, $amt) as $idx) - $tmpStore[] = [$idx => $amt]; + Util::arraySumByKey($tmpStore, [$idx => $amt]); } if (!empty($tmpStore[Stat::HEALING_SPELL_POWER]) && !empty($tmpStore[Stat::DAMAGE_SPELL_POWER]) && $tmpStore[Stat::HEALING_SPELL_POWER] == $tmpStore[Stat::DAMAGE_SPELL_POWER]) { - $tmpStore[] = [Stat::SPELL_POWER => $tmpStore[Stat::HEALING_SPELL_POWER]]; + Util::arraySumByKey($tmpStore, [Stat::SPELL_POWER => $tmpStore[Stat::HEALING_SPELL_POWER]]); unset($tmpStore[Stat::HEALING_SPELL_POWER]); unset($tmpStore[Stat::DAMAGE_SPELL_POWER]); }