summaryrefslogtreecommitdiffstats
path: root/lib/evendoors
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-09 11:21:00 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-09 11:21:00 +0200
commita47cb5c5b4c9cc8cf959500160db50cee620215d (patch)
tree561c0a9dd7c4620396f5d567f870ce144edd299e /lib/evendoors
parent51c79ed8bbdf2bc75cea37f1468ccbbd0f2d54d1 (diff)
downloadedoors-ruby-a47cb5c5b4c9cc8cf959500160db50cee620215d.zip
edoors-ruby-a47cb5c5b4c9cc8cf959500160db50cee620215d.tar.gz
Room: cleanup try_links
Diffstat (limited to 'lib/evendoors')
-rw-r--r--lib/evendoors/room.rb16
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