diff agent.pl @ 201:eec013e81fb0

fixed count warehouse level
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 03 Nov 2008 13:10:50 +0800
parents b33c8dbe9b04
children 2c2dcbcc5c4d
line wrap: on
line diff
--- a/agent.pl	Mon Nov 03 12:56:19 2008 +0800
+++ b/agent.pl	Mon Nov 03 13:10:50 2008 +0800
@@ -50,9 +50,9 @@
     my @warehouse = (qw/undef undef 0 4 9 16 18 19 20 21 22 23 24 25/);
     my @cities = keys(%{$self->{ikariam}->{cities}});
 
-    Carp::carp(sprintf("Required warehouse level %s, current is %s only\n", $warehouse[$#cities], $city->{buildings}->{warehouse}));
+    Carp::carp(sprintf("Required warehouse level %s, current is %s\n", $warehouse[$#cities], $city->{buildings}->{warehouse}));
     return 0 if(!defined($city->{buildings}->{warehouse}));
-    return ($city->{buildings}->{warehouse} > $warehouse[$#cities]) ? 0 : 1;
+    return ($city->{buildings}->{warehouse} >= $warehouse[$#cities]) ? 1 : 0;
 }
 
 sub is_corruption {