diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:21:00 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:21:00 +0200 |
commit | a47cb5c5b4c9cc8cf959500160db50cee620215d (patch) | |
tree | 561c0a9dd7c4620396f5d567f870ce144edd299e /lib/evendoors/room.rb | |
parent | 51c79ed8bbdf2bc75cea37f1468ccbbd0f2d54d1 (diff) | |
download | edoors-ruby-a47cb5c5b4c9cc8cf959500160db50cee620215d.zip edoors-ruby-a47cb5c5b4c9cc8cf959500160db50cee620215d.tar.gz |
Room: cleanup try_links
Diffstat (limited to 'lib/evendoors/room.rb')
-rw-r--r-- | lib/evendoors/room.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb index 358d53c..e947a70 100644 --- a/lib/evendoors/room.rb +++ b/lib/evendoors/room.rb @@ -52,23 +52,17 @@ module EvenDoors p.set_link_fields link.cond_fields if not apply_link if apply_link or (p.link_value==link.cond_value) # link matches ! - if not pending_link.nil? + if pending_link p2 = EvenDoors::Twirl.require_p p.class p2.clone_data p - p2.src = link.door - p2.clear_dsts! - p2.add_dsts link.dsts - p2.set_link_fields link.fields + p2.apply_link! link send_p p2 end pending_link = link end end if pending_link - p.src = pending_link.door - p.clear_dsts! - p.add_dsts pending_link.dsts - p.set_link_fields pending_link.fields + p.apply_link! pending_link send_p p end (not pending_link.nil?) @@ -104,7 +98,9 @@ module EvenDoors # boomerang p.dst_routed! p.src end - elsif not try_links p + elsif try_links p + return + else p.error! EvenDoors::ERROR_ROUTE_NDNL end puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug |