# HG changeset patch # User "Rex Tsai " # Date 1226946525 -28800 # Node ID 689c4c9fa56b69d7ab5442438c29a1d46a70511e # Parent 2d205c5396887d535cc77645a7826da2b810f682 fixed loop diff -r 2d205c539688 -r 689c4c9fa56b warfare.pl --- a/warfare.pl Mon Nov 17 19:15:51 2008 +0800 +++ b/warfare.pl Tue Nov 18 02:28:45 2008 +0800 @@ -106,10 +106,11 @@ my $c = Ikariam::Report->search_victim($city->cityId, time - 24*60*60 - 7*60*60)->count(); # check the current plunders foreach (@{$self->{ikariam}->{'military'}->{'homeland'}}) { - # we don't attack same city twice at same time. - next if($_->{to} == $city->cityId); # counting for both leaving and coming back. $c++ if($_->{to} == $city->cityId || $_->{from} == $city->cityId); + + # we don't attack same city twice at same time. + next CITY if($_->{to} == $city->cityId); } # we attack one city maximum 4 times a day. next if($c >= 4);