From: Michael Andreen Date: Sat, 30 May 2009 19:23:44 +0000 (+0200) Subject: Need to trunc the value, not round it X-Git-Url: https://ruin.nu/git/%3CTMPL_VAR%20NAME=PAGE%3E?a=commitdiff_plain;h=d7fb98229df0785d44926ac061ab2b48cf11f4b3;p=NDIRC.git Need to trunc the value, not round it --- diff --git a/Commands/PA.pm b/Commands/PA.pm index 0d83484..811d102 100644 --- a/Commands/PA.pm +++ b/Commands/PA.pm @@ -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){