]> ruin.nu Git - ndwebbie.git/blobdiff - NDWeb/Pages/TargetList.pm
Make relationship and planet_status an enum
[ndwebbie.git] / NDWeb / Pages / TargetList.pm
index 64fed86b117e187a0f3bccfbbb1f18b0e564daa8..97c0be4fdcfcb9594d60a9d611e81fde13678f33 100644 (file)
@@ -55,7 +55,7 @@ FROM current_planet_stats p
        JOIN (SELECT g.x,g.y, sum(p.value) AS nfvalue
        FROM galaxies g join current_planet_stats p on g.x = p.x AND g.y = p.y 
        WHERE g.tick = (SELECT max(tick) from galaxies)
-               AND ((planet_status IS NULL OR NOT planet_status IN ('Friendly','NAP')) AND  (relationship IS NULL OR NOT relationship IN ('Friendly','NAP'))) 
+               AND ((NOT planet_status IN ('Friendly','NAP')) AND  (NOT relationship IN ('Friendly','NAP'))) 
        GROUP BY g.x,g.y
        ) g ON p.x = g.x AND p.y = g.y
        JOIN current_planet_stats pa ON pa.x = g.x AND pa.y = g.y
@@ -66,10 +66,7 @@ ORDER BY $order
                });
        $query->execute;
        my @alliances;
-       my $i = 0;
        while (my $alliance = $query->fetchrow_hashref){
-               $i++;
-               $alliance->{ODD} = $i % 2;
                push @alliances,$alliance;
        }
        $BODY->param(Alliances => \@alliances);