From 35dc835c62a34105166119ca509e84d07b631c9a Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 28 Apr 2018 13:32:16 +0200 Subject: [PATCH] NPCs/Detail Page * fixed vendors displaying the same sell price for every item --- includes/types/item.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/types/item.class.php b/includes/types/item.class.php index d82c34f4..06a92848 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -147,8 +147,11 @@ class ItemList extends BaseType // no extended cost or additional gold required if (!$costs || $this->getField('flagsExtra') & 0x04) + { + $this->getEntry($k); if ($_ = $this->getField('buyPrice')) $data[0] = $_; + } $vendors[$l] = $data; } @@ -259,6 +262,10 @@ class ItemList extends BaseType if ($addInfoMask & ITEMINFO_JSON) $this->extendJsonStats(); + $extCosts = []; + if ($addInfoMask & ITEMINFO_VENDOR) + $extCosts = $this->getExtendedCost($miscData); + foreach ($this->iterate() as $__) { foreach ($this->json[$this->id] as $k => $v) @@ -294,9 +301,9 @@ class ItemList extends BaseType { // just use the first results // todo (med): dont use first result; search for the right one - if (!empty($this->getExtendedCost($miscData)[$this->id])) + if (!empty($extCosts[$this->id])) { - $cost = reset($this->getExtendedCost($miscData)[$this->id]); + $cost = reset($extCosts[$this->id]); $currency = []; $tokens = [];