sc: lower precedence of hp order
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 28 Oct 2021 00:20:18 +0000 (02:20 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 6 Dec 2021 11:07:29 +0000 (12:07 +0100)
sc.plp

diff --git a/sc.plp b/sc.plp
index 042719abfc79cab58320c5e1393abf11d004acb5..1c9e7b673f1c4b10108fc8c621e266786ccda8ea 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -366,11 +366,6 @@ sub showrangeint {
                if ($get{order} eq 'name') {
                        @rows = sort {$a->{name} cmp $b->{name}} @rows;
                }
-               elsif ($get{order} eq 'hp') {
-                       $_->{order} = (
-                               $_->{hp}*1.01 + $_->{armor} + $_->{shield} + $_->{size}/1024,
-                       ) for @rows;
-               }
                elsif ($get{order} eq 'cost') {
                        $_->{order} = (
                                $_->{gas}*1.5 + $_->{min} + $_->{pop}/8 + $_->{build}/256/8
@@ -391,6 +386,11 @@ sub showrangeint {
                                + $_->{hp}/512 + $_->{min}/8192
                        ) for @rows;
                }
+               elsif ($get{order} eq 'hp') {
+                       $_->{order} = (
+                               $_->{hp}*1.01 + $_->{armor} + $_->{shield} + $_->{size}/1024,
+                       ) for @rows;
+               }
                elsif ($get{order} eq 'attack') {
                        $_->{order} = $_->{hp} / 1024 + $_->{shield} / 1008 + max(
                                map {