# HG changeset patch # User "Rex Tsai " # Date 1235877052 -28800 # Node ID 2cfa03edc22e39973a03941a4a6b2000ba0d5709 # Parent 2444685c68c95fb9c34e30f806187f0b1a377bcd ignore island we don't know yet diff -r 2444685c68c9 -r 2cfa03edc22e enemy.pl --- a/enemy.pl Sun Mar 01 11:10:32 2009 +0800 +++ b/enemy.pl Sun Mar 01 11:10:52 2009 +0800 @@ -31,10 +31,11 @@ my $city; $city->{id} = $target->id; $city->{name} = $target->cityname; - $city->{island}->{id} = $island->id; - $city->{island}->{x} = $island->x; - $city->{island}->{y} = $island->y; - + if(defined($island)) { + $city->{island}->{id} = $island->id; + $city->{island}->{x} = $island->x; + $city->{island}->{y} = $island->y; + } push (@cities, $city); } } @@ -108,6 +109,7 @@ printf("\nCities\n"); foreach my $city ($u->cities) { my $island = Ikariam::Island->retrieve($city->island); + next if(!defined($island)); printf("Name: %s [%s:%s]\n", $city->cityname, $island->x, $island->y); if(defined($city->status)) {