Skip to content

Commit

Permalink
glyphinator: catch error that some users were seeing running out of e…
Browse files Browse the repository at this point in the history
…xcavators
  • Loading branch information
cxreg authored and b2gills committed Jul 6, 2011
1 parent b24d34d commit 7343a66
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/glyphinator.pl
Expand Up @@ -706,7 +706,7 @@ sub send_excavators {

my $launch_count;
my $built_count = 0;
if ($status->{ready}{$planet}) {
if ($status->{ready}{$planet} and @{$status->{ready}{$planet}}) {
verbose("Prepping excavators on $planet\n");
my $port = $status->{spaceports}{$planet};
my $originally_docked = @{$status->{ready}{$planet}};
Expand Down Expand Up @@ -753,6 +753,12 @@ sub send_excavators {
# Get the next available excavator
my $ex = $status->{ready}{$planet}[0];

unless (defined $ex) {
diag("No excavators left when we still had destinations, possible bug?\n");
$all_done = 1;
last;
}

# Only try each destination once
$skip{$dest_name}++;

Expand Down

0 comments on commit 7343a66

Please sign in to comment.