From 0fcd138f86fb2dd23633cb157aa3a95971981e73 Mon Sep 17 00:00:00 2001 From: WizardJesse1 Date: Tue, 9 Feb 2016 19:30:35 -0500 Subject: [PATCH] Fix Magic Check Issues I forgot to check a few things when i changed magic check's Issues Fix * You couldn't teleport but now you can * Illegal items would throw an error * Process elements would get removed even if you couldn't cast the spell due to moving illegal items --- data/plugins/skill/magic/magic.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/data/plugins/skill/magic/magic.rb b/data/plugins/skill/magic/magic.rb index 2c2d6c47..e9a7514b 100644 --- a/data/plugins/skill/magic/magic.rb +++ b/data/plugins/skill/magic/magic.rb @@ -31,9 +31,13 @@ class SpellAction < Action @pulses = 0 end + def illegal_item? + false + end + def execute if @pulses == 0 - unless process_elements && check_skill + unless check_skill stop return end @@ -42,8 +46,8 @@ class SpellAction < Action stop return false end + process_elements end - execute_action @pulses += 1 end @@ -113,10 +117,6 @@ class ItemSpellAction < SpellAction super end - def illegal_item? - false - end - end # Intercepts the magic on item message. @@ -149,7 +149,6 @@ on :message, :button do |player, message| unless tele.nil? player.start_action(TeleportingAction.new(player, tele)) message.terminate - return end conv = CONVERT_SPELLS[button]