Permalink
Browse files

glyphinator: catch error that some users were seeing running out of e…

…xcavators
  • Loading branch information...
cxreg authored and b2gills committed Mar 24, 2011
1 parent b24d34d commit 7343a66b02cce3c1c2a92235fece134fe1f7f926
Showing with 7 additions and 1 deletion.
  1. +7 −1 examples/glyphinator.pl
View
@@ -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}};
@@ -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}++;

0 comments on commit 7343a66

Please sign in to comment.