Setup/ItemStats

* fixed array structure when converting equal amounts of SPELL_DAMAGE and SPELL_HEALING to SPELL_POWER
This commit is contained in:
Sarjuuk
2025-01-20 06:34:38 +01:00
parent c1eecb4c22
commit d86936f6f5

View File

@@ -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]);
}