# HG changeset patch # User "Rex Tsai " # Date 1225264875 -28800 # Node ID 554bdd49c70337316c228bd5278a4eb7b6742838 # Parent 31803acb9c5ff48121ab29cd0f27ef460a6f83d2 we should also count the force which is coming back diff -r 31803acb9c5f -r 554bdd49c703 warfare.pl --- a/warfare.pl Wed Oct 29 15:14:58 2008 +0800 +++ b/warfare.pl Wed Oct 29 15:21:15 2008 +0800 @@ -75,11 +75,12 @@ # check if we over-attacked my $c = Ikariam::Report->search_attack($city->cityId, time - 24*60*60 - 7*60*60)->count(); # check the current plunders - foreach (@{$self->{ikariam}->{'military'}->{'homeland'}}) { - $c++ if($_->{to} eq $city->cityId); + foreach ($self->{ikariam}->{'military'}->{'homeland'}) { + $c++ if($_{to} eq $city->cityId); + $c++ if($_{from} eq $city->cityId); } next if($c >= 4); - + # { # if(1) { my $capture = $city->citylevel * ($city->citylevel - 1) * $sheep->trader_score_secondary / 10000; @@ -118,6 +119,7 @@ my $cities = $i->check; $i->checkMilitaryAdvisorCombatReports(); + foreach my $cityId (keys(%$cities)) { print Dump($i->{'military'}); # build and upgrade for cities