From e98253f3ad7a68c70dd5382f47ac7c3691fac022 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Fri, 25 Jul 2008 11:07:45 +0200 Subject: [PATCH 1/1] Fixed two minor bugs. Actually remove duplicate scans, the die call made the remove rollback. Remove scans for planets that have been removed, they are not useful so no point saving them. --- scripts/scans.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/scans.pl b/scripts/scans.pl index e9795f7..5b9e74e 100755 --- a/scripts/scans.pl +++ b/scripts/scans.pl @@ -97,11 +97,16 @@ while (my $scan = $newscans->fetchrow_hashref){ $dbh->pg_rollback_to('scans') or die "rollback didn't work"; $delscan->execute($scan->{id}); $addpoints->execute(-1,$scan->{uid}) if $scan->{uid} > 0; - die "Duplicate scan: $scan->{id} http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}\n"; + warn "Duplicate scan: $scan->{id} http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}\n"; + next; } my ($planet) = $dbh->selectrow_array($findplanet,undef,$x,$y,$z,$tick); unless ($planet){ $dbh->pg_rollback_to('scans') or die "rollback didn't work"; + if ( $x == 0 && $y == 0 && $z == 0 ){ + $delscan->execute($scan->{id}); + $addpoints->execute(-1,$scan->{uid}) if $scan->{uid} > 0; + } next; } my $scantext = ""; -- 2.39.2