summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/evendoors.rb11
-rw-r--r--lib/evendoors/room.rb4
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/evendoors.rb b/lib/evendoors.rb
index 408549e..29b6d66 100644
--- a/lib/evendoors.rb
+++ b/lib/evendoors.rb
@@ -20,10 +20,13 @@ module EvenDoors
LNK_CONDV = 'edoors_lnk_condv'.freeze
#
ERROR_FIELD = 'edoors_error'.freeze
- ERROR_ROUTE_RRWD = 'routing error: right room, wrong door'.freeze
- ERROR_ROUTE_TRWR = 'routing error: top room, wrong room'.freeze
- ERROR_ROUTE_NDNL = 'routing error: no destination, no link'.freeze
- ERROR_ROUTE_SND = 'routing error: system no destination'.freeze
+ ERROR_ROUTE_ND = '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_TRWR = 'routing error: top room, wrong room'.freeze
+ ERROR_ROUTE_NDNL = 'routing error: no destination, no link'.freeze
+ ERROR_ROUTE_SND = 'routing error: system no destination'.freeze
+ ERROR_ROUTE_SNDNA = 'routing error: system no door, no action'.freeze
#
class Exception < ::Exception; end
#
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb
index 2a38ac9..4214965 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -75,7 +75,9 @@ module EvenDoors
end
#
def route_p p, door_name
- if p.room.nil? or p.room==path
+ if door_name.empty?
+ p.error! EvenDoors::ERROR_ROUTE_NDN
+ elsif p.room.nil? or p.room==path
if door = @spots[door_name]
p.dst_done! door
else