From d29ac23b4c0f046c1da9f5e0a8245f1dce8396e5 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Thu, 16 Jul 2020 12:02:27 +0200 Subject: [PATCH] Sort raid targets by size, value and score --- lib/NDWeb/Controller/Raids.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.39.2