From 54b20c31318ce6f84c763a19451740bb53e7811e Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Wed, 26 Feb 2020 17:29:33 +0100 Subject: [PATCH] NPC/Spells * always treat spells from creature_template_spell as controlled abilities --- includes/smartAI.class.php | 7 ++----- pages/npc.php | 11 ++--------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/includes/smartAI.class.php b/includes/smartAI.class.php index a5878d23..62bafcbc 100644 --- a/includes/smartAI.class.php +++ b/includes/smartAI.class.php @@ -713,11 +713,8 @@ class SmartAI $tooltip = '[tooltip name=a-'.$this->rowKey.']'.Lang::smartAI('actionTT', array_merge([$a['type']], $a['param'])).'[/tooltip][span tooltip=a-'.$this->rowKey.']%s[/span]'; - // additional parameters - $a['param'][6] = ''; - $a['param'][7] = ''; - $a['param'][8] = ''; - $a['param'][9] = ''; + // init additional parameters + $a['param'] = array_pad($a['param'], 10, ''); switch ($a['type']) { diff --git a/pages/npc.php b/pages/npc.php index 967f7440..61090408 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -421,15 +421,8 @@ class NpcPage extends GenericPage if (in_array($id, $smartSpells)) { $normal[$id] = $values; - unset($controled[$id]); - continue; - } - - // not quite right. All seats should be checked for allowed-to-cast-flag-something - if (!$this->subject->getField('vehicleId') && in_array($id, $tplSpells)) - { - $normal[$id] = $values; - unset($controled[$id]); + if (!in_array($id, $tplSpells)) + unset($controled[$id]); } }