X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FRaids.pm;h=944b6914d2a1f3371ab7799b4bc9e3f90af9a29c;hb=b34d60e2292fd751d6baa3bf26f561687dbcb5f6;hp=db2618b42417c9b9c5e6cf3d93e4a2fb3fc8e0be;hpb=831088fa9ab0362a5091b54b33db1f61437ccdfc;p=ndwebbie.git diff --git a/lib/NDWeb/Controller/Raids.pm b/lib/NDWeb/Controller/Raids.pm index db2618b..944b691 100644 --- a/lib/NDWeb/Controller/Raids.pm +++ b/lib/NDWeb/Controller/Raids.pm @@ -141,7 +141,7 @@ sub view : Local { if ($planet->{x} == $target->{x}){ $target->{style} = 'incluster'; } - $target->{scorebash} = 'bash' if ($target->{score}/$planet->{score} < 0.4); + $target->{scorebash} = 'bash' if ($target->{score}/$planet->{score} < 0.6); $target->{valuebash} = 'bash' if ($target->{value}/$planet->{value} < 0.4); #next if ($target->{score}/$planet->{score} < 0.4) && ($target->{value}/$planet->{value} < 0.4); } @@ -247,7 +247,7 @@ sub edit : Local { my $targetquery = $dbh->prepare(qq{SELECT r.id,coords(x,y,z),comment,size ,score,value,race,planet_status,relationship,r.planet, s.scans - ,max(rc.wave) AS waves + ,COALESCE(max(rc.wave),0) AS waves FROM raid_targets r JOIN current_planet_stats p ON p.id = r.planet LEFT OUTER JOIN ( SELECT planet, array_accum(s::text) AS scans @@ -272,7 +272,9 @@ sub edit : Local { my @targets; while (my $target = $targetquery->fetchrow_hashref){ my @waves; - $target->{waves} ||= $raid->{waves}; + if ($target->{waves} < $raid->{waves}){ + $target->{waves} = $raid->{waves} + } for my $i (1 .. $target->{waves}){ $claims->execute($target->{id},$i); my $claimers;