Spell/Sources

* always display quest source from RewardSpellCast
 * fix inherited quest sources via learn spells
 * closes #353
This commit is contained in:
Sarjuuk
2025-10-22 18:57:33 +02:00
parent 6ea1457c4f
commit f9ace6a671

View File

@@ -1066,6 +1066,7 @@ class SpellBaseResponse extends TemplateResponse implements ICache
$tbsData = []; $tbsData = [];
if (!$tbSpell->error) if (!$tbSpell->error)
{ {
$tbsData = $tbSpell->getFoundIDs();
$this->lvTabs->addListviewTab(new Listview(array( $this->lvTabs->addListviewTab(new Listview(array(
'data' => $tbSpell->getListviewData(), 'data' => $tbSpell->getListviewData(),
'id' => 'taught-by-spell', 'id' => 'taught-by-spell',
@@ -1076,15 +1077,14 @@ class SpellBaseResponse extends TemplateResponse implements ICache
} }
// tab: taught by quest // tab: taught by quest
$conditions = ['OR', ['sourceSpellId', $this->typeId], ['rewardSpell', $this->typeId]]; $conditions = array(
'OR',
['sourceSpellId', $this->typeId],
['rewardSpell', $this->typeId],
['rewardSpellCast', $this->typeId]
);
if ($tbsData) if ($tbsData)
{ array_push($conditions, ['rewardSpell', $tbsData], ['rewardSpellCast', $tbsData]);
$conditions[] = ['rewardSpell', array_keys($tbsData)];
if (User::isInGroup(U_GROUP_EMPLOYEE))
$conditions[] = ['rewardSpellCast', array_keys($tbsData)];
}
if (User::isInGroup(U_GROUP_EMPLOYEE))
$conditions[] = ['rewardSpellCast', $this->typeId];
$tbQuest = new QuestList($conditions); $tbQuest = new QuestList($conditions);
if (!$tbQuest->error) if (!$tbQuest->error)