]> ruin.nu Git - ndwebbie.git/commitdiff
Remove a few warnings
authorMichael Andreen <harv@ruin.nu>
Sat, 1 Nov 2008 14:20:03 +0000 (15:20 +0100)
committerMichael Andreen <harv@ruin.nu>
Sat, 1 Nov 2008 14:45:35 +0000 (15:45 +0100)
lib/NDWeb/Controller/Raids.pm
lib/NDWeb/Include.pm
root/lib/inc/stats.tt2
root/src/members/index.tt2
root/src/stats/galaxy.tt2
root/src/stats/planet.tt2

index 16ce6b508d715fdbb025032e677c3bf0735d24fb..98b3a39e8012033296983490f3d7af9152565eb1 100644 (file)
@@ -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};
index 1974724f7951ad1f3694efcfd8d301d86f00f2a0..b5acfbb43d8ca8f6e7d6eb58515b92f5e7f368b0 100644 (file)
@@ -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{
index 68e0308dcee97955cfadfd5579e6e28430822221..6ff6e0b2e8951e334648337e5b701e02a050c3c7 100644 (file)
@@ -1,3 +1,4 @@
+[% IF g %]
 <table class="stats">
        <tr align="center"><th colspan="4">Rank</th>
        </tr>
@@ -39,6 +40,7 @@
                <td>[% g.ticks_roiding %]</td>
        </tr>
 </table>
+[% END %]
 
 <table>
        <tr align="center"><th colspan="4">Rank</th>
index 05e56d54018768cee881179c46cfb058f981a3dc..be9a5cc3fa07a1aa19b4b9e13d9fecd0069fdc3b 100644 (file)
@@ -18,7 +18,7 @@
 [% END %]
 <div class="clear"></div>
 
-[% IF c.user.planet %]
+[% IF p %]
 <table class="stats">
        <tr align="center"><th colspan="4">Rank</th>
        </tr>
index 4e27a6bf46d3abbc2c4201f1f7f51894a334f104..b66f74ed18945b4d9123d282566649d4b1765ccd 100644 (file)
@@ -1,6 +1,10 @@
 [% META title = 'Galaxy stats' %]
+[% IF g %]
 [% PROCESS inc/stats.tt2 %]
 <div class="leftinfo">
 <img class="graph" src="[% c.uri_for('/graphs/galaxystats',g.x,g.y,STICK) %]" alt="stats" height="300" width="500">
 <img class="graph" src="[% c.uri_for('/graphs/galaxyranks',g.x,g.y,STICK) %]" alt="ranks" height="300" width="500">
 </div>
+[% ELSE %]
+<p>No such galaxy</p>
+[% END %]
index d8d9f665037329c29912c83e800f8b3a01c3aa56..fb0784397d92c39d323b8c7cc9d5e7805319ccf5 100644 (file)
@@ -1,5 +1,9 @@
 [% META title = 'Planet stats' %]
+[% IF p.id %]
 [% PROCESS inc/stats.tt2 %]
+[% ELSE %]
+<p> No such planet</p>
+[% END %]
 
 <div class="leftinfo">
 [% IF planetscan.tick %]
 </div>
 [% END %]
 
+[% IF p.id %]
 <div class="leftinfo">
 <img class="graph" src="[% c.uri_for('/graphs/planetstats',p.id,STICK) %]" alt="stats" height="300" width="500">
 <img class="graph" src="[% c.uri_for('/graphs/planetranks',p.id,STICK) %]" alt="ranks" height="300" width="500">
 </div>
+[% END %]