From 4e848e29a743539088b053e5164a72f6e3cd2879 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 28 Dec 2025 19:38:31 +0100 Subject: [PATCH] Quests/Fixup * fix missing objective quantity if required entity is unknwon * don't display go/npc objective if go/npc id is 0 --- endpoints/quest/quest.php | 4 ++-- includes/dbtypes/quest.class.php | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/endpoints/quest/quest.php b/endpoints/quest/quest.php index 4b347eb5..4229fabf 100644 --- a/endpoints/quest/quest.php +++ b/endpoints/quest/quest.php @@ -335,7 +335,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache if (!$olItemData->getEntry($itemId)) { - $this->objectiveList[] = [0, new IconElement(0, 0, Util::ucFirst(Lang::game('item')).' #'.$itemId, $qty > 1 ? $qty : '', extraText: $provided ? Lang::quest('provided') : null)]; + $this->objectiveList[] = [0, new IconElement(0, 0, Util::ucFirst(Lang::game('item')).' #'.$itemId, $qty > 1 ? $qty : '', size: IconElement::SIZE_SMALL, extraText: $provided ? Lang::quest('provided') : null)]; continue; } @@ -448,7 +448,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache continue; if (!$olGOData->getEntry($i)) - $this->objectiveList[] = [0, new IconElement(0, 0, Util::ucFirst(Lang::game('object')).' #'.$i, $qty > 1 ? $qty : '')]; + $this->objectiveList[] = [0, new IconElement(0, 0, Util::ucFirst(Lang::game('object')).' #'.$i, $qty > 1 ? $qty : '', size: IconElement::SIZE_SMALL)]; else $this->objectiveList[] = [0, new IconElement( Type::OBJECT, diff --git a/includes/dbtypes/quest.class.php b/includes/dbtypes/quest.class.php index 7754a173..215657ff 100644 --- a/includes/dbtypes/quest.class.php +++ b/includes/dbtypes/quest.class.php @@ -338,13 +338,15 @@ class QuestList extends DBTypeList $rng = $this->curTpl['reqNpcOrGo'.$i]; $rngQty = $this->curTpl['reqNpcOrGoCount'.$i]; - if ($rngQty < 1 && (!$rng || $ot)) + if (!$ot && ($rngQty < 1 || !$rng)) continue; if ($ot) $name = $ot; - else - $name = $rng > 0 ? CreatureList::getName($rng) : Lang::unescapeUISequences(GameObjectList::getName(-$rng), Lang::FMT_HTML); + else if ($rng > 0) + $name = CreatureList::getName($rng); + else if ($rng < 0) + $name = Lang::unescapeUISequences(GameObjectList::getName(-$rng), Lang::FMT_HTML); if (!$name) $name = Util::ucFirst(Lang::game($rng > 0 ? 'npc' : 'object')).' #'.abs($rng);