Author: dragonking
Date: Thu Jul 31 17:22:50 2008
New Revision: 28292
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28292&view=rev
Log:
one more time recruitment
Modified:
trunk/data/recruitment.fai
Modified: trunk/data/recruitment.fai
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/recruitment.fai?rev=28292&r1=28291&r2=28292&view=diff
==============================================================================
--- trunk/data/recruitment.fai (original)
+++ trunk/data/recruitment.fai Thu Jul 31 17:22:50 2008
@@ -506,6 +506,11 @@
)
);
+def unit_map_cost_filter(ai*, unit_map)
+ filter( unit_map,
+ get_unit_type(key).cost < my_side.gold
+ );
+
# ========== Main formula section ========== #
def initialize_weapon_specials_map(ai*)
@@ -545,15 +550,21 @@
if(vars.turn_initialized = turn,
if(my_leader.loc = loc(11,23),
- if( debug_print('Najtanszy rekrut: ', choose(
- vars.recruits_map,
- -key.cost
- )).key.cost <
+ if(
+ get_unit_type(
+ choose(
+ vars.recruits_map,
+ -get_unit_type(key).cost
+ ).key
+ ).cost <
my_side.gold,
recruit(
unit_chooser(
self,
- vars.recruits_map
+ unit_map_cost_filter(
+ self,
+ vars.recruits_map
+ )
)
),
fallback('')
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits