while (my $target = $targets->fetchrow_hashref){
my %target;
$target{Id} = $target->{id};
- $target{Coords} = $target->{id};
my @waves;
for (my $i = 1; $i <= $raid->{waves}; $i++){
my %wave;
$claimers = join '/', @claimers;
if ($owner){
$wave{Command} = 'Unclaim';
- if ($raid->{released_coords}){
- $target{Coords} = $DBH->selectrow_array('SELECT coords(x,y,z) FROM current_planet_stats WHERE id = ?',undef,$target->{planet});
- }
}elsif ($joinable){
$wave{Command} = 'Join';
}else{
for (my $i = 1; $i <= $raid->{waves}; $i++){
my $roids = floor(0.25*$size);
$size -= $roids;
- my $xp;
+ my $xp = 0;
if ($planet){
$xp = max(0,floor($roids * 10 * (min(2,$target{Score}/$planet->{score}) + min(2,$target{Value}/$planet->{value})-1)));
}
sub listTargets () : method {
my $self = shift;
my $DBH = $self->{DBH};
- my $query = $DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, released_coords, coords(x,y,z),c.launched,c.wave,c.joinable
+ my $query = $DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick,
+ (released_coords AND old_claim(timestamp)) AS released_coords, coords(x,y,z),c.launched,c.wave,c.joinable
FROM raid_claims c
JOIN raid_targets t ON c.target = t.id
JOIN raids r ON t.raid = r.id
b.setAttribute("onclick", "claim('"+dataSource+"',"+target+","+wave+",'"+command+"');");
obj.appendChild(b);
}
+ /*@cc_on
obj.innerHTML = obj.innerHTML; // IE doesn't understand unless you tell it twice
+ @*/
}
+ /*
obj = document.getElementById("coords"+target);
var coords = targets[i].getElementsByTagName("coords");;
if (obj)
obj.innerHTML = coords[0].firstChild.nodeValue;
+ */
}
if (timestamp){
timestamp = xmlthingy.getElementsByTagName("timestamp");
</span>
</p>
</form>
- <p>Target coords: <span id="coords<TMPL_VAR NAME=Id>"><TMPL_VAR NAME=Coords></span></p>
</fieldset>
</TMPL_LOOP>
<TMPL_IF Ajax>
<joinable><TMPL_VAR NAME=Joinable></joinable>
</wave>
</TMPL_LOOP>
- <coords><TMPL_VAR NAME=Coords></coords>
</target>
</TMPL_LOOP>
</targets>