SmartAI/Spells

* fixed fetching casters for spellId (as seen on 'used by' tabs)
This commit is contained in:
Sarjuuk
2022-02-28 09:11:22 +01:00
parent 19584feab0
commit 8431329645
2 changed files with 3 additions and 3 deletions

View File

@@ -125,7 +125,7 @@ class SmartAI
$qParts[] = $aq.implode(' OR ', $pq).'))';
}
$smartS = DB::World()->select(sprintf('SELECT `source_type` AS "0", `entryOrGUID` AS "1" FROM smart_scripts WHERE (%s){ AND `source_type` IN (?a)} GROUP BY "0", "1"', $qParts ? implode(' OR ', $qParts) : '0'), $genLimit ?: DBSIMPLE_SKIP);
$smartS = DB::World()->select(sprintf('SELECT `source_type` AS "0", `entryOrGUID` AS "1" FROM smart_scripts WHERE (%s){ AND `source_type` IN (?a)}', $qParts ? implode(' OR ', $qParts) : '0'), $genLimit ?: DBSIMPLE_SKIP);
// filter for TAL shenanigans
if ($smartTAL = array_filter($smartS, function ($x) {return $x[0] == SAI_SRC_TYPE_ACTIONLIST;}))
@@ -145,7 +145,7 @@ class SmartAI
$q[] = '`action_type` = '.SAI_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST.' AND `action_param1` <= '.$eog.' AND `action_param2` >= '.$eog;
}
if ($_ = DB::World()->select(sprintf('SELECT `source_type` AS "0", `entryOrGUID` AS "1" FROM smart_scripts WHERE ((%s)){ AND `source_type` IN (?a)} GROUP BY "0", "1"', $q ? implode(') OR (', $q) : '0'), $talLimit ?: DBSIMPLE_SKIP))
if ($_ = DB::World()->select(sprintf('SELECT `source_type` AS "0", `entryOrGUID` AS "1" FROM smart_scripts WHERE ((%s)){ AND `source_type` IN (?a)}', $q ? implode(') OR (', $q) : '0'), $talLimit ?: DBSIMPLE_SKIP))
$smartS = array_merge($smartS, $_);
}

View File

@@ -1566,7 +1566,7 @@ class SpellPage extends GenericPage
$effDS = (int)$this->subject->getField('effect'.$i.'DieSides');
$effRPPL = $this->subject->getField('effect'.$i.'RealPointsPerLevel');
$effAura = (int)$this->subject->getField('effect'.$i.'AuraId');
$foo = &$effects[];
$foo = &$effects[$i];
// Icons:
// .. from item