From: Michael Andreen Date: Thu, 16 Jul 2020 10:02:27 +0000 (+0200) Subject: Sort raid targets by size, value and score X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=d29ac23b4c0f046c1da9f5e0a8245f1dce8396e5 Sort raid targets by size, value and score --- diff --git a/lib/NDWeb/Controller/Raids.pm b/lib/NDWeb/Controller/Raids.pm index 61956b2..ae9c7a6 100644 --- a/lib/NDWeb/Controller/Raids.pm +++ b/lib/NDWeb/Controller/Raids.pm @@ -131,7 +131,7 @@ sub view : Local { LEFT OUTER JOIN current_development_scans ds USING (pid) WHERE r.raid = $1 AND NOT COALESCE(p.x = $2 AND p.y = $3,False) - ORDER BY size}); + ORDER BY size DESC, value DESC, score DESC}); $targetquery->execute($raid->{id},$planet->{x},$planet->{y}); my @targets; while (my $target = $targetquery->fetchrow_hashref){ @@ -206,7 +206,7 @@ ORDER BY name,tick DESC push @targets,$target; } - @targets = sort {$b->{roids}[0]{xp} <=> $a->{roids}[0]{xp} or $b->{size} <=> $a->{size}} @targets; + #@targets = sort {$b->{roids}[0]{xp} <=> $a->{roids}[0]{xp} or $b->{size} <=> $a->{size}} @targets; $c->stash(targets => \@targets); }