sc: improve hots unit size fallback order
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 19 Jun 2015 09:48:36 +0000 (11:48 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 22 Jun 2015 13:38:51 +0000 (15:38 +0200)
sc.plp

diff --git a/sc.plp b/sc.plp
index 48cb282d3a8ea3cf7b8e53aad663b3c290c2c1bc..2217dc67d09b634cb84d6ffb377c0fd76d64c466 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -285,10 +285,15 @@ sub showrange {
                $grouped = 0;
                $get{order} ||= '';
                if ($get{order} eq 'size') {
-                       $_->{order} = $_->{unit}*8 + $_->{suit} + $_->{hp}/512 + $_->{min}/8192 for @$units;
+                       $_->{order} = (
+                               $_->{unit}*16 + ($_->{size} // $_->{suit}) + $_->{cargo}/8
+                               + $_->{hp}/512 + $_->{min}/8192
+                       ) for @$units;
                }
                elsif ($get{order} eq 'cost') {
-                       $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
+                       $_->{order} = (
+                               $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8
+                       ) for @$units;
                }
                else {
                        $units->[$_]->{order} = $_ for 0 .. $#$units;