X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=intel.pl;h=5db6f9bdbe1ef9a7fffca368b4fb2324ffb64034;hb=ccf38f8bef1adef7c1ef8797d8c84e477bc82305;hp=c1beff473da2c6281a714af4d1fe9e2d4d9ed25d;hpb=9e7bc0a25ae14affe960a0606d0542677c51abd7;p=ndwebbie.git diff --git a/intel.pl b/intel.pl index c1beff4..5db6f9b 100644 --- a/intel.pl +++ b/intel.pl @@ -18,6 +18,8 @@ #**************************************************************************/ use strict; +use warnings FATAL => 'all'; +no warnings qw(uninitialized); use POSIX; our $BODY; our $DBH; @@ -135,7 +137,7 @@ if ($planet){ my $query = $DBH->prepare(intelquery('o.alliance AS oalliance,coords(o.x,o.y,o.z) AS origin',"t.id = ? $showticks")); $query->execute($planet->{id}) or $error .= $DBH->errstr; my @intellists; - my @intel; + my @incomings; my $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ @@ -143,27 +145,27 @@ if ($planet){ }else{ $intel->{missionclass} = $intel->{mission}; } - $intel->{ODD} = $i % 2; - push @intel,$intel; $i++; + $intel->{ODD} = $i % 2; + push @incomings,$intel; } - push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1}; + push @intellists,{Message => 'Incoming fleets', Intel => \@incomings, Origin => 1}; - my $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks")); + $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks")); $query->execute($planet->{id}) or $error .= $DBH->errstr; - my @intel; - my $i = 0; + my @outgoings; + $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ $intel->{missionclass} = 'ingal'; }else{ $intel->{missionclass} = $intel->{mission}; } - $intel->{ODD} = $i % 2; - push @intel,$intel; $i++; + $intel->{ODD} = $i % 2; + push @outgoings,$intel; } - push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1}; + push @intellists,{Message => 'Outgoing Fleets', Intel => \@outgoings, Target => 1}; $BODY->param(IntelLIsts => \@intellists); @@ -184,9 +186,9 @@ if ($planet){ }else{ $intel->{missionclass} = $intel->{mission}; } + $i++; $intel->{ODD} = $i % 2; push @intel,$intel; - $i++; } push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1}; $BODY->param(IntelLIsts => \@intellists);