diff agent.pl @ 56:6e0d5e781949

fixed a typo in agent.pl
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 21 Oct 2008 00:00:33 +0800
parents ff00d108e955
children 9307c559f9bf
line wrap: on
line diff
--- a/agent.pl	Mon Oct 20 23:44:45 2008 +0800
+++ b/agent.pl	Tue Oct 21 00:00:33 2008 +0800
@@ -87,10 +87,10 @@
     my @marble = qw/undef 0 0 17 28 66 95 156 243 406 579 799 1348 2124 2951 4409 6461 8187 10176 12466 15082 18055 21381 25116 100464 200928 401856 803712 1607424 3214848 6429696 12859392/;
 
     my $level = $city->{buildings}->{townHall};
-    if($city->{resources}->{woold} >= $wood[$level] && $city->{resources}->{marble} >= $marble[$level] ) {
+    if($city->{resources}->{wood} >= $wood[$level] && $city->{resources}->{marble} >= $marble[$level] ) {
         return 1;
     }
-    warn("Resource is short for build city hall.");
+    warn(sprintf("Resource is short for build city hall. wood [%d] marble [%d] ", $wood[$level], $marble[$level]));
     return 0;
 }