sc: round damage values
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 10 Jun 2015 20:54:12 +0000 (22:54 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 10 Jun 2015 23:40:32 +0000 (01:40 +0200)
Avoid fractions for calculated values.

sc.plp

diff --git a/sc.plp b/sc.plp
index 44940e5a06bc88f21a884132e647c482321e83a2..8ce0ba7a0816ea7839933b7a664d0756608c15f9 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -200,8 +200,8 @@ sub showrange {
                elsif ($type eq 'implosive') {
                        $min /= 4;
                }
                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";
 }
 
        return $min == $max ? $min : "$min-$max";
 }