X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=calls.pl;h=159892c2d0bd99cdfa7e2b411dfb62aaf0b9cc58;hb=d19bfd06cfbd72cfd09c0c2ace0142d9ee5be468;hp=8aab04a63540aaa10a071b0ea2a604888fd59ca5;hpb=0b56588fa1846b0d487e677ca8534277a1f0b9d7;p=ndwebbie.git diff --git a/calls.pl b/calls.pl index 8aab04a..159892c 100644 --- a/calls.pl +++ b/calls.pl @@ -19,7 +19,6 @@ use strict; use warnings FATAL => 'all'; -no warnings qw(uninitialized); use POSIX; our $BODY; our $DBH; @@ -31,7 +30,7 @@ $ND::TEMPLATE->param(TITLE => 'Defense Calls'); die "You don't have access" unless isDC(); my $call; -if (param('call') =~ /^(\d+)$/){ +if (defined param('call') && param('call') =~ /^(\d+)$/){ my $query = $DBH->prepare(q{ SELECT c.id, coords(p.x,p.y,p.z), c.landing_tick, c.info, covered, open, dc.username AS dc, u.defense_points,c.member FROM calls c @@ -41,7 +40,7 @@ FROM calls c WHERE c.id = ?}); $call = $DBH->selectrow_hashref($query,undef,$1); } -if ($call){ +if ($call && defined param('cmd')){ if (param('cmd') eq 'Submit'){ $DBH->begin_work; if (param('ctick')){ @@ -171,12 +170,14 @@ ORDER BY p.x,p.y,p.z}); $BODY->param(Attackers => \@attackers); }else{ my $where = 'open AND c.landing_tick-6 > tick()'; - if (param('show') eq 'covered'){ - $where = 'covered'; - }elsif (param('show') eq 'all'){ - $where = 'true'; - }elsif (param('show') eq 'uncovered'){ - $where = 'not covered'; + if (defined param('show')){ + if (param('show') eq 'covered'){ + $where = 'covered'; + }elsif (param('show') eq 'all'){ + $where = 'true'; + }elsif (param('show') eq 'uncovered'){ + $where = 'not covered'; + } } my $pointlimits = $DBH->prepare(q{SELECT value :: int FROM misc WHERE id = ?}); my ($minpoints) = $DBH->selectrow_array($pointlimits,undef,'DEFMIN');