From 6f578e9d1708c53be4011829c77abef79f5a0df5 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Mon, 23 Apr 2012 21:07:40 -0600 Subject: [PATCH] Maxlevel may be undef if no spaceport found for berth check. --- lib/Lacuna/RPC/Building/SpacePort.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index 3a920255..f0e78911 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -313,6 +313,10 @@ sub prepare_send_spies { body_id => $on_body_id, efficiency => 100, } )->get_column('level')->max; + unless ($max_level) { + $max_level = 1; +# confess [1009, "Cannot send spies without any ships."]; + } my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, @@ -442,6 +446,11 @@ sub prepare_fetch_spies { efficiency => 100, } )->get_column('level')->max; + unless ($max_level) { + $max_level = 1; +# confess [1009, "Cannot fetch spies without any ships."]; + } + my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, task=>'Docked', body_id => $to_body_id, -- 2.51.2