]> ruin.nu Git - ndwebbie.git/commitdiff
Switched target and sender for Launch news items, and properly set amount as null...
authorMichael Andreen <harv@ruin.nu>
Tue, 15 Jan 2008 09:27:00 +0000 (10:27 +0100)
committerMichael Andreen <harv@ruin.nu>
Tue, 15 Jan 2008 09:27:00 +0000 (10:27 +0100)
scripts/scans.pl

index 3e01d7823944242fdd470a1c7d4cb85f68ffa246..30c4b5999925fe0fc42811806a3b28cba39ce6ad 100755 (executable)
@@ -128,7 +128,7 @@ while (my $scan = $newscans->fetchrow_hashref){
                                        my ($target) = $dbh->selectrow_array($findplanet,undef
                                                ,$2,$3,$4,$t) or die $dbh->errstr;
                                        die "No target: $2:$3:$4" unless defined $target;
-                                       my $id = addfleet($1,$mission,undef,$planet,$target,$6
+                                       my $id = addfleet($1,$mission,undef,$target,$planet,$6
                                                ,$eta,$back,undef, ($x == $2 && $y == $3));
                                        $fleetscan->execute($id,$scan->{id}) or die $dbh->errstr;
                                }elsif($news eq 'Incoming' && $text =~ m/We have detected an open jumpgate from (.*?), located at (\d+):(\d+):(\d+). The fleet will approach our system in tick (\d+) and appears to have roughly (\d+) ships/g){
@@ -195,7 +195,7 @@ sub addfleet {
                $total += $2;
                push @ships, [$1,$2];
        }
-       $amount = $total if not defined $amount && defined $ships;
+       $amount = $total if (!defined $amount) && defined $ships;
        my $id = $dbh->selectrow_array($addfleet,undef,$name,$mission,$sender
                ,$target,$tick, $eta, $back, $amount,$ingal) or die $dbh->errstr;
        for my $s (@ships){