From 8431329645db4f65910a6f1bfb75e6bd3571a8d6 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Mon, 28 Feb 2022 09:11:22 +0100 Subject: [PATCH] SmartAI/Spells * fixed fetching casters for spellId (as seen on 'used by' tabs) --- includes/smartAI.class.php | 4 ++-- pages/spell.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/smartAI.class.php b/includes/smartAI.class.php index 88dbc472..9c4983f6 100644 --- a/includes/smartAI.class.php +++ b/includes/smartAI.class.php @@ -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, $_); } diff --git a/pages/spell.php b/pages/spell.php index 34ab28c5..425fede9 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -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