X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=intel.pl;h=90498c29dd5307b56cfe8af6e2779956f59f3153;hb=a7ae358d160b38caae7c074d03745b4e7cd704be;hp=65f847a46921823807a09f90eed602c74c95f12c;hpb=aa6a1cd834d42beaf03b7b9ddb5e5686ea3b132e;p=ndwebbie.git diff --git a/intel.pl b/intel.pl index 65f847a..90498c2 100644 --- a/intel.pl +++ b/intel.pl @@ -136,12 +136,15 @@ 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}; } + $i++; + $intel->{ODD} = $i % 2; push @intel,$intel; } push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1}; @@ -149,12 +152,15 @@ if ($planet){ 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}; } + $i++; + $intel->{ODD} = $i % 2; push @intel,$intel; } push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1}; @@ -171,12 +177,15 @@ 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}; } + $i++; + $intel->{ODD} = $i % 2; push @intel,$intel; } push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1};