Item/DetailPage

* fixed infobox cost for items with buycount > 1
This commit is contained in:
Sarjuuk
2021-03-14 16:31:35 +01:00
parent 6f69144498
commit 56e70e22bb

View File

@@ -192,6 +192,7 @@ class ItemPage extends genericPage
if (!empty($this->subject->getExtendedCost([], $_reqRating)[$this->subject->id]))
{
$vendors = $this->subject->getExtendedCost()[$this->subject->id];
$stack = $this->subject->getField('buyCount');
$each = $this->subject->getField('stackable') > 1 ? '[color=q0] ('.Lang::item('each').')[/color]' : null;
$handled = [];
$costList = [];
@@ -215,12 +216,12 @@ class ItemPage extends genericPage
if ($c < 0) // currency items (and honor or arena)
{
$currency[] = -$c.','.$qty;
$currency[] = -$c.','.($qty / $stack);
$this->extendGlobalIds(TYPE_CURRENCY, -$c);
}
else if ($c > 0) // plain items (item1,count1,item2,count2,...)
{
$tokens[$c] = $c.','.$qty;
$tokens[$c] = $c.','.($qty / $stack);
$this->extendGlobalIds(TYPE_ITEM, $c);
}
}
@@ -231,7 +232,7 @@ class ItemPage extends genericPage
$handled[] = md5(serialize($data));
$cost = isset($data[0]) ? '[money='.$data[0] : '[money';
$cost = isset($data[0]) ? '[money='.($data[0] / $stack) : '[money';
if ($tokens)
$cost .= ' items='.implode(',', $tokens);