Fix unexpected return in magic plugin

This commit is contained in:
Major
2016-01-06 13:52:55 +00:00
parent d7234f1294
commit a86a03b930
+11 -11
View File
@@ -124,21 +124,21 @@ end
on :message, :magic_on_item do |player, message| on :message, :magic_on_item do |player, message|
spell = message.spell_id spell = message.spell_id
alch = ALCHEMY_SPELLS[spell] alchemy = ALCHEMY_SPELLS[spell]
unless alch.nil? unless alchemy.nil?
slot = message.slot slot = message.slot
item = player.inventory.get(slot) item = player.inventory.get(slot)
player.start_action(AlchemyAction.new(player, alch, slot, item)) player.start_action(AlchemyAction.new(player, alchemy, slot, item))
message.terminate message.terminate
return else
end enchant = ENCHANT_SPELLS[message.id]
ench = ENCHANT_SPELLS[message.id] if !enchant.nil? && enchant.button == spell
if !ench.nil? && ench.button == spell slot = message.slot
slot = message.slot item = player.inventory.get(slot)
item = player.inventory.get(slot) player.start_action(EnchantAction.new(player, enchant, slot, item, ENCHANT_ITEMS[item.id]))
player.start_action(EnchantAction.new(player, ench, slot, item, ENCHANT_ITEMS[item.id])) message.terminate
message.terminate end
end end
end end