diff scan.pl @ 126:3196b1f5dc13

merged changes.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 31 Oct 2008 00:51:49 +0800
parents 6043e9bfdeef
children 124fc7abda39
line wrap: on
line diff
--- a/scan.pl	Thu Oct 30 15:10:07 2008 +0800
+++ b/scan.pl	Fri Oct 31 00:51:49 2008 +0800
@@ -13,8 +13,7 @@
         return;
     }
 
-    foreach my $h_city (@cities)
-    {
+    foreach my $h_city (@cities) {
         $h_city->{island} = $island;
         $h_city->{'time'} = time;
         my $c = Ikariam::Cities->retrieve($h_city->{cityId});
@@ -28,7 +27,7 @@
         $c->update();
 
         my $user = Ikariam::User->retrieve($h_city->{'user'});
-        next if (defined($user) && $user->time le (time - 60*60*1));
+        next if (defined($user) && defined($user->time) && $user->time le (time - 60*60*1));
 
         saveUser($h_city->{owner});
     }
@@ -96,6 +95,7 @@
 } else {
     die("Usage: $0\nUsage: $0 x y\n");
 }
+
 foreach my $h_island (@islands)
 {
     printf("checking island %d\n", $h_island->{id});