From: Michael Andreen Date: Sat, 1 Nov 2008 14:20:03 +0000 (+0100) Subject: Remove a few warnings X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=27f93c2b1d0e6c9c8a073b18ed508cf68ded6003 Remove a few warnings --- diff --git a/lib/NDWeb/Controller/Raids.pm b/lib/NDWeb/Controller/Raids.pm index 16ce6b5..98b3a39 100644 --- a/lib/NDWeb/Controller/Raids.pm +++ b/lib/NDWeb/Controller/Raids.pm @@ -4,7 +4,7 @@ use strict; use warnings; use parent 'Catalyst::Controller'; -use POSIX; +use POSIX qw/floor pow/; use NDWeb::Include; use ND::Include; @@ -129,7 +129,7 @@ sub view : Local { $targetquery->execute($raid->{id},$planet->{x},$planet->{y}); my @targets; while (my $target = $targetquery->fetchrow_hashref){ - if ($planet){ + if ($planet && $planet->{x}){ if ($planet->{x} == $target->{x}){ $target->{style} = 'incluster'; } @@ -171,7 +171,7 @@ sub view : Local { my $roids = floor(0.25*$size); $size -= $roids; my $xp = 0; - if ($planet){ + if ($planet && $planet->{score}){ $xp = pa_xp($roids,$planet->{score},$planet->{value},$target->{score},$target->{value}); } push @roids,{wave => $i, roids => $roids, xp => $xp}; diff --git a/lib/NDWeb/Include.pm b/lib/NDWeb/Include.pm index 1974724..b5acfbb 100644 --- a/lib/NDWeb/Include.pm +++ b/lib/NDWeb/Include.pm @@ -26,7 +26,7 @@ use CGI qw/:standard/; our @ISA = qw/Exporter/; -our @EXPORT = qw/parseMarkup min max +our @EXPORT = qw/parseMarkup intelquery html_escape comma_value array_expand/; @@ -60,17 +60,6 @@ sub parseMarkup ($) { return $text; } - -sub min { - my ($x,$y) = @_; - return ($x > $y ? $y : $x); -} - -sub max { - my ($x,$y) = @_; - return ($x < $y ? $y : $x); -} - sub intelquery { my ($columns,$where) = @_; return qq{ diff --git a/root/lib/inc/stats.tt2 b/root/lib/inc/stats.tt2 index 68e0308..6ff6e0b 100644 --- a/root/lib/inc/stats.tt2 +++ b/root/lib/inc/stats.tt2 @@ -1,3 +1,4 @@ +[% IF g %] @@ -39,6 +40,7 @@
Rank
[% g.ticks_roiding %]
+[% END %] diff --git a/root/src/members/index.tt2 b/root/src/members/index.tt2 index 05e56d5..be9a5cc 100644 --- a/root/src/members/index.tt2 +++ b/root/src/members/index.tt2 @@ -18,7 +18,7 @@ [% END %]
-[% IF c.user.planet %] +[% IF p %]
Rank
diff --git a/root/src/stats/galaxy.tt2 b/root/src/stats/galaxy.tt2 index 4e27a6b..b66f74e 100644 --- a/root/src/stats/galaxy.tt2 +++ b/root/src/stats/galaxy.tt2 @@ -1,6 +1,10 @@ [% META title = 'Galaxy stats' %] +[% IF g %] [% PROCESS inc/stats.tt2 %]
stats ranks
+[% ELSE %] +

No such galaxy

+[% END %] diff --git a/root/src/stats/planet.tt2 b/root/src/stats/planet.tt2 index d8d9f66..fb07843 100644 --- a/root/src/stats/planet.tt2 +++ b/root/src/stats/planet.tt2 @@ -1,5 +1,9 @@ [% META title = 'Planet stats' %] +[% IF p.id %] [% PROCESS inc/stats.tt2 %] +[% ELSE %] +

No such planet

+[% END %]
[% IF planetscan.tick %] @@ -125,7 +129,9 @@
[% END %] +[% IF p.id %]
stats ranks
+[% END %]
Rank