X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=intel.pl;fp=intel.pl;h=c1beff473da2c6281a714af4d1fe9e2d4d9ed25d;hb=9e7bc0a25ae14affe960a0606d0542677c51abd7;hp=65f847a46921823807a09f90eed602c74c95f12c;hpb=aa6a1cd834d42beaf03b7b9ddb5e5686ea3b132e;p=ndwebbie.git diff --git a/intel.pl b/intel.pl index 65f847a..c1beff4 100644 --- a/intel.pl +++ b/intel.pl @@ -136,26 +136,32 @@ if ($planet){ $query->execute($planet->{id}) or $error .= $DBH->errstr; my @intellists; my @intel; + my $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++; } push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1}; my $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; 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++; } push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1}; @@ -171,13 +177,16 @@ if ($planet){ my @intellists; my @intel; + my $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++; } push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1}; $BODY->param(IntelLIsts => \@intellists);