diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-06 14:42:25 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-07 12:09:07 +0200 |
commit | 5f7ded6de3e2749962b1a75140440b022e15b92a (patch) | |
tree | 4f27cf732ba1c122539fdc3a44b15e4b1573e057 /lib/evendoors | |
parent | 9d44cb5ddc88a867668a3ff04917fab5e50b1974 (diff) | |
download | edoors-ruby-5f7ded6de3e2749962b1a75140440b022e15b92a.zip edoors-ruby-5f7ded6de3e2749962b1a75140440b022e15b92a.tar.gz |
Room: send_sys call error! when neither door_name or action are set in the destinatino, on action only, route to space
Diffstat (limited to 'lib/evendoors')
-rw-r--r-- | lib/evendoors/room.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb index 4214965..f619f10 100644 --- a/lib/evendoors/room.rb +++ b/lib/evendoors/room.rb @@ -106,7 +106,16 @@ module EvenDoors def send_sys_p p if d = p.dst puts " * send_sys #{d.to_str} ..." if EvenDoors::Twirl.debug - route_p p, p.split_dst! + door_name = p.split_dst! + if door_name.empty? + if p.action.nil? + p.error! EvenDoors::ERROR_ROUTE_SNDNA + else + p.dst_done! space + end + else + route_p p, door_name + end puts " -> #{p.door.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug EvenDoors::Twirl.send_sys_p p else |