]> ruin.nu Git - NDIRC.git/commitdiff
use float to not get integer overflow
authorMichael Andreen <harv@ruin.nu>
Tue, 27 Nov 2007 18:18:31 +0000 (19:18 +0100)
committerMichael Andreen <harv@ruin.nu>
Tue, 27 Nov 2007 18:18:31 +0000 (19:18 +0100)
PA.pm

diff --git a/PA.pm b/PA.pm
index da637fc7ba20a3fcc3d935541e3594da02721da3..b1ae3619434f9a68039b6e07a99c5362e86aad35 100644 (file)
--- a/PA.pm
+++ b/PA.pm
@@ -269,7 +269,7 @@ sub findCovOpper {
        }
        my $attackers = $ND::DBH->prepare(q{
                SELECT coords(p.x,p.y,p.z), ruler, planet FROM current_planet_stats p JOIN planet_stats ps using (id) WHERE 
-               ps.tick = $1 AND (2000*$2*$3/ps.value)::int = $4 ;
+               ps.tick = $1 AND (2000.0*$2*$3/ps.value)::int = $4 ;
                });
        $attackers->execute($tick,$agents,$value,$stolen);
        if ($attackers->rows == 0){