summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-09 10:03:13 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-09 10:03:13 +0200
commit926d94249ce40216f98c6e0c66b22fbf88582821 (patch)
tree5747a577c1a61131642d15ad53e659365a7f3283
parent1200008d135ec248d6dd63327f6e6b46c0a1361d (diff)
downloadedoors-ruby-926d94249ce40216f98c6e0c66b22fbf88582821.zip
edoors-ruby-926d94249ce40216f98c6e0c66b22fbf88582821.tar.gz
Room detect drill down and goto error
-rw-r--r--lib/evendoors.rb1
-rw-r--r--lib/evendoors/room.rb3
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/evendoors.rb b/lib/evendoors.rb
index 6ea8644..e8d7047 100644
--- a/lib/evendoors.rb
+++ b/lib/evendoors.rb
@@ -23,6 +23,7 @@ module EvenDoors
ERROR_ROUTE_NDN = 'routing error: no door name'.freeze
ERROR_ROUTE_NMD = 'routing error: no more destination'.freeze
ERROR_ROUTE_RRWD = 'routing error: right room, wrong door'.freeze
+ ERROR_ROUTE_RRNDD = 'routing error: right room, no drill down'.freeze
ERROR_ROUTE_TRWR = 'routing error: top room, wrong room'.freeze
ERROR_ROUTE_NDNS = 'routing error: no destination, no source'.freeze
ERROR_ROUTE_NDNL = 'routing error: no destination, no link'.freeze
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb
index fdee3e7..6e464d2 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -83,6 +83,9 @@ module EvenDoors
else
p.error! EvenDoors::ERROR_ROUTE_RRWD
end
+ elsif (p.room=~/^#{path}/)==0
+ # TODO allow drill down ?!?
+ p.error! EvenDoors::ERROR_ROUTE_RRNDD
elsif @parent
@parent.route_p p
else