Rebase the MessageHandler, MessageHandlerChain and MessageHandlerChainSet

Rebased several other pieces of code
This commit is contained in:
atomicint
2015-03-29 12:52:55 -04:00
parent 7f345fffac
commit 654a1a6dfd
71 changed files with 452 additions and 457 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
#
# If you only wish to intercept a message, use the intercept method, e.g.
#
# intercept :item_on_item, used_id, target_id, :irreversible do |ctx, player, message|
# intercept :item_on_item, used_id, target_id, :irreversible do |player, message|
# # code here
# end
+3 -3
View File
@@ -36,11 +36,11 @@ class ItemOnItemPair
end
# Adds a message handler to the item on item message.
on :message, :item_on_item do |ctx, player, message|
# Adds a message listener to the item on item message.
on :message, :item_on_item do |player, message|
used, target = message.id, message.target_id
pair = ItemOnItemPair.new(used, target)
block = ITEM_PAIRS[pair]
block.call(ctx, player, message) unless block == nil
block.call(player, message) unless block == nil
end