Added a counter for sticky candidate actions and a comment for Crab

This commit is contained in:
Dmitry Kovalenko 2011-06-26 18:51:43 +00:00
parent 4a8ffbcd63
commit 74cf9b5ae3

View file

@ -86,6 +86,13 @@ Gs^Fp , Gs^Fp , Wwf , Wwf , Mm , Rd
-- Define your global constants here.
-- ...
ai = {}
ca_counter = 0
-- @Crab_: this preload event in my opinion should be carried out in a separate file and included in all scenarios
-- that intend to use lua, because it contains some vital code. Implementations of patrol could be kept here
-- or carried out somewhere else, depending on what we want. This counter is as simple as it is, but not protected at all
-- I think if users try to mess with it, it's they're own fault. If this needs protection we can put it in a table a protect
-- with a metatable.
H.set_wml_var_metatable(_G)
@ -308,6 +315,7 @@ end
--wesnoth.modify_ai({side=2, action="delete", path="stage[ca_loop].candidate_action[firstca]"})
function my_ai:do_moves()
my_leader = wesnoth.get_units({side = 1, can_recruit=yes})[1].name