Fix unexpected return in magic plugin

This commit is contained in:
Major
2016-01-06 13:52:55 +00:00
parent d7234f1294
commit a86a03b930
+12 -12
View File
@@ -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