# HG changeset patch # User "Rex Tsai " # Date 1224164600 -28800 # Node ID 65e847de5187e9c46f8a9ad865575a3d552b247a # Parent 0863b32e1a05428a0c7ef6ebc9a39eb6474d889d refined the defending rules diff -r 0863b32e1a05 -r 65e847de5187 inference.pl --- a/inference.pl Thu Oct 16 21:42:16 2008 +0800 +++ b/inference.pl Thu Oct 16 21:43:20 2008 +0800 @@ -45,12 +45,15 @@ my $cityId = shift; # 城鎮跟圍牆 - if($cities->{$cityId}->{buildings}->{wall} < $cities->{$cityId}->{buildings}->{townHall}) { - Warn($cityId, sprintf("Wall level (%d) is lower then town hall (%d)!", - $cities->{$cityId}->{buildings}->{wall}, - $cities->{$cityId}->{buildings}->{townHall} - )) - if($cities->{$cityId}->{construction} != 1); + if($cities->{$cityId}->{construction} != 1) { + if($cities->{$cityId}->{buildings}->{wall} < $cities->{$cityId}->{buildings}->{townHall}) { + Warn($cityId, sprintf("Wall level (%d) is lower then town hall (%d)!", + $cities->{$cityId}->{buildings}->{wall}, + $cities->{$cityId}->{buildings}->{townHall} + )) + } else { + Warn($cityId, sprintf("is not building.")); + } } } @@ -117,7 +120,7 @@ } } -foreach my $procedure (qw/rule_war rule_engagement/) { +foreach my $procedure (qw/rule_engagement/) { foreach my $id (keys(%$cities)) { eval(sprintf("%s(%s);", $procedure, $id)); last;