summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/evendoors.rb1
-rw-r--r--lib/evendoors/room.rb2
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/evendoors.rb b/lib/evendoors.rb
index 31d1745..6ea8644 100644
--- a/lib/evendoors.rb
+++ b/lib/evendoors.rb
@@ -24,6 +24,7 @@ module EvenDoors
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_NDNS = 'routing error: no destination, no source'.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
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb
index 3c7ebc6..be5325b 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -97,6 +97,8 @@ module EvenDoors
route_p p
puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug
EvenDoors::Twirl.send_p p
+ elsif p.src.nil?
+ p.error! EvenDoors::ERROR_ROUTE_NDNS
elsif not try_links p
p.error! EvenDoors::ERROR_ROUTE_NDNL
puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug