]> ruin.nu Git - NDIRC.git/commitdiff
Need to trunc the value, not round it
authorMichael Andreen <harv@ruin.nu>
Sat, 30 May 2009 19:23:44 +0000 (21:23 +0200)
committerMichael Andreen <harv@ruin.nu>
Sat, 30 May 2009 19:23:44 +0000 (21:23 +0200)
Commands/PA.pm

index 0d834846ae6e30b3edb9986f94fd657b5116441f..811d102dab3a8ee8ab4386d8ca4cff22ed13d29f 100644 (file)
@@ -166,7 +166,7 @@ SELECT value,score FROM planet_stats WHERE tick = $2 AND
        my $attackers = $c->model->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.0*$2*$3/ps.value)::int = $4
+WHERE ps.tick = $1 AND trunc(2000.0*$2*$3/ps.value)::int = $4
                });
        $attackers->execute($tick,$agents,$value,$stolen);
        if ($attackers->rows == 0){