comparison agent.pl @ 278:b2510d9339d8

fixed warehouse level
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 02 Dec 2008 17:11:39 +0800
parents c1333052a4ed
children 4c1eb583b97c
comparison
equal deleted inserted replaced
277:cea21f99e56f 278:b2510d9339d8
82 } 82 }
83 83
84 sub is_warehouse_enough { 84 sub is_warehouse_enough {
85 my ($self, $city) = @_; 85 my ($self, $city) = @_;
86 # my @warehouse = (qw/undef undef 0 4 9 16 18 19 20 21 22 23 24 25/); 86 # my @warehouse = (qw/undef undef 0 4 9 16 18 19 20 21 22 23 24 25/);
87 my @warehouse = (qw/undef undef 0 4 9 15 17 19 20 21 22 23 24 25/); 87 my @warehouse = (qw/undef undef 0 4 9 15 17 18 19 20 21 22 23 24/);
88 my @cities = keys(%{$self->{ikariam}->{cities}}); 88 my @cities = keys(%{$self->{ikariam}->{cities}});
89 my $nextCities = ($#cities + 1) + 1; 89 my $nextCities = ($#cities + 1) + 1;
90 90
91 Carp::carp(sprintf("Required warehouse level %s for next city (%s), current is %s\n", $warehouse[$nextCities], $nextCities, $city->{buildings}->{warehouse})); 91 Carp::carp(sprintf("Required warehouse level %s for next city (%s), current is %s\n", $warehouse[$nextCities], $nextCities, $city->{buildings}->{warehouse}));
92 return 0 if(!defined($city->{buildings}->{warehouse})); 92 return 0 if(!defined($city->{buildings}->{warehouse}));