X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/80a615f8414664e34d48d6ffc1263943ae6fbf73..bd7288335390bc941dde7a1ad728bc0000d8386a:/sc.plp?ds=sidebyside diff --git a/sc.plp b/sc.plp index 44940e5..873c75b 100644 --- a/sc.plp +++ b/sc.plp @@ -200,8 +200,8 @@ sub showrange { elsif ($type eq 'implosive') { $min /= 4; } - $min = int($min + .5); # round halves up }} + $_ = int($_ + .5) for $min, $max; # round halves up return $min == $max ? $min : "$min-$max"; } @@ -252,7 +252,7 @@ sub showrange { if (exists $get{order}) { $get{order} ||= ''; if ($get{order} eq 'size') { - $_->{order} = $_->{unit}*8 + $_->{size} + $_->{hp}/512 + $_->{min}/8192 for @$units; + $_->{order} = $_->{unit}*8 + $_->{suit} + $_->{hp}/512 + $_->{min}/8192 for @$units; } elsif ($get{order} eq 'cost') { $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units; @@ -269,7 +269,7 @@ sub showrange { printf '

%s

'."\n", $race, ucfirst $race if $grouped and $race ne $_->{race}; $_->{cat} = $_->{race} if not $grouped; - my $sizechar = [qw/? s m l/]->[$_->{size}]; + my $suitchar = [qw/? s m l/]->[$_->{suit}]; print( '', sprintf('%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')), @@ -280,7 +280,7 @@ sub showrange { !!$_->{base} && '+', $_->{build} || '0', ), - sprintf('%s', $sizechar, ucfirst $sizechar), + sprintf('%s', $suitchar, ucfirst $suitchar), '' . join('', $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ', defined $_->{organic} && sprintf(