summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/evendoors.rb4
-rw-r--r--lib/evendoors/room.rb13
2 files changed, 7 insertions, 10 deletions
diff --git a/lib/evendoors.rb b/lib/evendoors.rb
index e8d7047..bf7a99b 100644
--- a/lib/evendoors.rb
+++ b/lib/evendoors.rb
@@ -20,12 +20,10 @@ module EvenDoors
LNK_CONDV = 'edoors_lnk_condv'.freeze
#
ERROR_FIELD = 'edoors_error'.freeze
- ERROR_ROUTE_NDN = 'routing error: no door name'.freeze
- ERROR_ROUTE_NMD = 'routing error: no more destination'.freeze
+ ERROR_ROUTE_NS = 'routing error: no source'.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
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 99e9139..358d53c 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -93,18 +93,17 @@ module EvenDoors
#
def send_p p
puts " * send_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if EvenDoors::Twirl.debug
- if p.next_dst
+ if p.src.nil?
+ # do not route orphan particles !!
+ p.error! EvenDoors::ERROR_ROUTE_NS, space
+ elsif p.next_dst
p.split_dst!
if p.door
- p.src = space if p.src.nil? # send error to space if needed
route_p p
- elsif p.src
- p.dst_routed! p.src
else
- p.error! EvenDoors::ERROR_ROUTE_NDNS, space
+ # boomerang
+ p.dst_routed! p.src
end
- elsif p.src.nil?
- p.error! EvenDoors::ERROR_ROUTE_NDNS, space
elsif not try_links p
p.error! EvenDoors::ERROR_ROUTE_NDNL
end