mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Items/Gems
* fixed indexing error when calculating item enchantments introduced in c7fe84b7e0
This commit is contained in:
@@ -1240,15 +1240,8 @@ class ItemList extends BaseType
|
|||||||
$this->itemMods[$this->id] = [];
|
$this->itemMods[$this->id] = [];
|
||||||
|
|
||||||
foreach (Game::$itemMods as $mod)
|
foreach (Game::$itemMods as $mod)
|
||||||
{
|
if ($_ = floatVal($this->curTpl[$mod]))
|
||||||
if (isset($this->curTpl[$mod]) && ($_ = floatVal($this->curTpl[$mod])))
|
Util::arraySumByKey($this->itemMods[$this->id], [$mod => $_]);
|
||||||
{
|
|
||||||
if (!isset($this->itemMods[$this->id][$mod]))
|
|
||||||
$this->itemMods[$this->id][$mod] = 0;
|
|
||||||
|
|
||||||
$this->itemMods[$this->id][$mod] += $_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// fetch and add socketbonusstats
|
// fetch and add socketbonusstats
|
||||||
if (!empty($this->json[$this->id]['socketbonus']))
|
if (!empty($this->json[$this->id]['socketbonus']))
|
||||||
@@ -1275,7 +1268,7 @@ class ItemList extends BaseType
|
|||||||
if ($item > 0) // apply socketBonus
|
if ($item > 0) // apply socketBonus
|
||||||
$this->json[$item]['socketbonusstat'] = array_filter($eStats[$eId]);
|
$this->json[$item]['socketbonusstat'] = array_filter($eStats[$eId]);
|
||||||
else /* if ($item < 0) */ // apply gemEnchantment
|
else /* if ($item < 0) */ // apply gemEnchantment
|
||||||
Util::arraySumByKey($this->json[-$item][$mod], array_filter($eStats[$eId]));
|
Util::arraySumByKey($this->json[-$item], array_filter($eStats[$eId]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user