mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 16:49:11 +00:00
Add support for specifying the option for events in the declaration (where applicable).
This commit is contained in:
@@ -54,12 +54,10 @@ class ConsumeAction < Action
|
||||
end
|
||||
|
||||
# Intercepts the first item option event and consumes the consumable, if necessary.
|
||||
on :event, :item_option do |ctx, player, event|
|
||||
if (event.option == 1)
|
||||
consumable = CONSUMABLES[event.id]
|
||||
unless consumable == nil
|
||||
player.start_action(ConsumeAction.new(player, event.slot, consumable))
|
||||
ctx.break_handler_chain
|
||||
end
|
||||
on :event, :first_item_option do |ctx, player, event|
|
||||
consumable = CONSUMABLES[event.id]
|
||||
unless consumable == nil
|
||||
player.start_action(ConsumeAction.new(player, event.slot, consumable))
|
||||
ctx.break_handler_chain
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user