Spells/Misc

* try to handle bogus data from creature_template_addon.auras
This commit is contained in:
Sarjuuk
2024-01-31 22:17:25 +01:00
parent a14b5e2be1
commit 85e8175338
3 changed files with 16 additions and 9 deletions

View File

@@ -852,10 +852,8 @@ class SpellPage extends GenericPage
if (!empty($ubSAI[Type::NPC]))
$conditions[] = ['id', $ubSAI[Type::NPC]];
if ($auras = DB::World()->selectCol('SELECT `entry` AS ARRAY_KEY, auras FROM creature_template_addon WHERE `auras` LIKE ?', '%'.$this->typeId.'%'))
if ($auras = array_filter($auras, function($x) { return preg_match('/\b'.$this->typeId.'\b/', $x); }))
$conditions[] = ['id', array_keys($auras)];
if ($auras = DB::World()->selectCol('SELECT `entry` FROM creature_template_addon WHERE `auras` REGEXP ?', '\\b'.$this->typeId.'\\b'))
$conditions[] = ['id', $auras];
$ubCreature = new CreatureList($conditions);
if (!$ubCreature->error)