]> ruin.nu Git - NDIRC.git/commitdiff
truncate numbers later, not sooner
authorMichael Andreen <harv@ruin.nu>
Mon, 5 Nov 2007 20:31:12 +0000 (21:31 +0100)
committerMichael Andreen <harv@ruin.nu>
Mon, 5 Nov 2007 20:31:12 +0000 (21:31 +0100)
PA.pm

diff --git a/PA.pm b/PA.pm
index 62382dd8bf65da26587baf787473d0a309c3d140..da637fc7ba20a3fcc3d935541e3594da02721da3 100644 (file)
--- a/PA.pm
+++ b/PA.pm
@@ -148,6 +148,7 @@ sub shipEff {
                                        $number /= 0.60 if $tn eq 't2';
                                        $number /= 0.30 if $tn eq 't3';
                                }
+                               $number = int($number);
                                $value = prettyValue($number*$t->{cost}/100);
                                my $name = shipColor($t->{name},$t->{type});
                                $text .= " $ND::B$number$ND::O $name ($t->{init}:$value),";
@@ -164,12 +165,12 @@ sub calcEff {
        my $number = 0;
        if ($eff){
                $number = $s->{type} eq 'Emp' ?
-                       int($amount*$s->{guns}*(100-$t->{eres})/100)
-                       : int($amount*$s->{damage}/$t->{armor});
+                       ($amount*$s->{guns}*(100-$t->{eres})/100)
+                       : ($amount*$s->{damage}/$t->{armor});
        }else{
                $number = $t->{type} eq 'Emp' ?
-                       int($amount*100/(100 - $s->{eres})/$t->{guns})
-                       : int($amount*$s->{armor}/$t->{damage});
+                       ($amount*100/(100 - $s->{eres})/$t->{guns})
+                       : ($amount*$s->{armor}/$t->{damage});
        }
 
        for my $tn ('t1','t2','t3'){