From a86a03b930c4560a53b31c7a7fc6dca3af07ee05 Mon Sep 17 00:00:00 2001 From: Major Date: Wed, 6 Jan 2016 13:52:55 +0000 Subject: [PATCH] Fix unexpected return in magic plugin --- data/plugins/skill/magic/magic.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/data/plugins/skill/magic/magic.rb b/data/plugins/skill/magic/magic.rb index 3f8b962e..5d468c85 100644 --- a/data/plugins/skill/magic/magic.rb +++ b/data/plugins/skill/magic/magic.rb @@ -124,21 +124,21 @@ end on :message, :magic_on_item do |player, message| spell = message.spell_id - alch = ALCHEMY_SPELLS[spell] - unless alch.nil? + alchemy = ALCHEMY_SPELLS[spell] + unless alchemy.nil? slot = message.slot item = player.inventory.get(slot) - player.start_action(AlchemyAction.new(player, alch, slot, item)) - message.terminate - return - end - - ench = ENCHANT_SPELLS[message.id] - if !ench.nil? && ench.button == spell - slot = message.slot - item = player.inventory.get(slot) - player.start_action(EnchantAction.new(player, ench, slot, item, ENCHANT_ITEMS[item.id])) + player.start_action(AlchemyAction.new(player, alchemy, slot, item)) message.terminate + else + enchant = ENCHANT_SPELLS[message.id] + + if !enchant.nil? && enchant.button == spell + slot = message.slot + item = player.inventory.get(slot) + player.start_action(EnchantAction.new(player, enchant, slot, item, ENCHANT_ITEMS[item.id])) + message.terminate + end end end