X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=calls.pl;h=8aab04a63540aaa10a071b0ea2a604888fd59ca5;hb=ccf38f8bef1adef7c1ef8797d8c84e477bc82305;hp=5fa57dff1ae9809ab5055664b5d511812379263f;hpb=4e43c322c67e8426100bb90d46fd43630a0608f2;p=ndwebbie.git diff --git a/calls.pl b/calls.pl index 5fa57df..8aab04a 100644 --- a/calls.pl +++ b/calls.pl @@ -18,6 +18,8 @@ #**************************************************************************/ use strict; +use warnings FATAL => 'all'; +no warnings qw(uninitialized); use POSIX; our $BODY; our $DBH; @@ -160,7 +162,7 @@ WHERE i.call = ? ORDER BY p.x,p.y,p.z}); $attackers->execute($call->{id}); my @attackers; - my $i = 0; + $i = 0; while(my $attacker = $attackers->fetchrow_hashref){ $i++; $attacker->{ODD} = $i % 2; @@ -181,7 +183,7 @@ ORDER BY p.x,p.y,p.z}); my ($maxpoints) = $DBH->selectrow_array($pointlimits,undef,'DEFMAX'); my $query = $DBH->prepare(qq{ -SELECT c.id, coords(p.x,p.y,p.z), u.defense_points, c.landing_tick, +SELECT c.id, coords(p.x,p.y,p.z), u.defense_points, c.landing_tick, c.dc, TRIM('/' FROM concat(p2.race||' /')) AS race, TRIM('/' FROM concat(i.amount||' /')) AS amount, TRIM('/' FROM concat(i.eta||' /')) AS eta, TRIM('/' FROM concat(i.shiptype||' /')) AS shiptype, TRIM('/' FROM concat(c.landing_tick - tick() ||' /')) AS curreta, @@ -193,7 +195,7 @@ FROM calls c JOIN current_planet_stats p ON u.planet = p.id JOIN current_planet_stats p2 ON i.sender = p2.id WHERE $where -GROUP BY c.id, p.x,p.y,p.z, u.username, c.landing_tick, c.info,u.defense_points +GROUP BY c.id, p.x,p.y,p.z, u.username, c.landing_tick, c.info,u.defense_points,c.dc ORDER BY c.landing_tick DESC })or $error .= $DBH->errstr; $query->execute or $error .= $DBH->errstr; @@ -213,6 +215,7 @@ ORDER BY c.landing_tick DESC push @calls,{}; $i = 0; } + $call->{dc} = 'Hostile' unless defined $call->{dc}; $i++; $call->{ODD} = $i % 2; $call->{shiptype} = escapeHTML($call->{shiptype});