diff warfare.pl @ 135:4194f261798b

check for transporters is available
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 31 Oct 2008 02:04:52 +0800
parents 2ff3704cca0e
children 25dcc1fffeef
line wrap: on
line diff
--- a/warfare.pl	Fri Oct 31 01:59:33 2008 +0800
+++ b/warfare.pl	Fri Oct 31 02:04:52 2008 +0800
@@ -21,9 +21,7 @@
          ORDER BY cities.citylevel * (cities.citylevel - 1) * user.trader_score_secondary / 10000 DESC
     }
 );
-# $island->tradegood, 
-# qw/NULL 葡萄酒 大理石 水晶 硫磺/;
-# 不打與自己相同的資源
+
 Ikariam::Report->set_sql(victim => qq {
         SELECT report.id
           FROM report
@@ -50,6 +48,11 @@
     return ($city->{actionPoints} > ($city->{maxActionPoints}/2) ) ? 1 : 0;
 }
 
+sub is_transporters_available {
+    my ($self, $city) = @_;
+    return ($city->{transporters}->{avail} > 0) ? 1 : 0;
+}
+
 sub is_army_available {
     my ($self, $city) = @_;
     return ($city->{army}->{Swordsman} >= 2 ) ? 1 : 0;