mail[Wesnoth-commits] r33715 - /trunk/data/ai/formula/recruitment.fai


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by dragonking on March 15, 2009 - 22:35:
Author: dragonking
Date: Sun Mar 15 22:35:11 2009
New Revision: 33715

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33715&view=rev
Log:
fixed recruitment

Modified:
    trunk/data/ai/formula/recruitment.fai

Modified: trunk/data/ai/formula/recruitment.fai
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/ai/formula/recruitment.fai?rev=33715&r1=33714&r2=33715&view=diff
==============================================================================
--- trunk/data/ai/formula/recruitment.fai (original)
+++ trunk/data/ai/formula/recruitment.fai Sun Mar 15 22:35:11 2009
@@ -549,6 +549,9 @@
                []
        );
 
+def castle_space(ai*)
+       filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( 
location ), 1, 0 ) ), self = 0  ).size;
+
 if(vars.turn_initialized = turn,
                if( 
                        get_unit_type(
@@ -558,19 +561,23 @@
                                ).key
                        ).cost <
                        my_side.gold,
-                       recruit(debug_print(
-                               unit_chooser(
-                                       self,
-                                       unit_map_cost_filter(
+                       if( castle_space(self),
+                               recruit(debug_print(
+                                       unit_chooser(
                                                self,
-                                               vars.recruits_map
-                                       )
-                               )
-                       )),
-                       fallback('') 
+                                               unit_map_cost_filter(
+                                                       self,
+                                                       vars.recruits_map
+                                               )
+                                       )
+                               )),
+                               fallback()
+                       ),
+                       fallback() 
                ),
        [set_var(debug_print('turn_initialized'), turn)] +
        initialize_weapon_specials_map(self) +
        create_recruits_map(self)
 )
+
 faiend




Related Messages


Powered by MHonArc, Updated Sun Mar 15 23:00:21 2009