Recache unit information for recruiting when era/scenario adds units...

...to the recruit list after the first unit is recruited
This commit is contained in:
Simon Forsyth 2012-12-03 22:42:01 +00:00
parent 4d67102e7a
commit c7c91fde55

View file

@ -497,6 +497,12 @@ return {
local recruitable_units = {}
for i, recruit_id in ipairs(wesnoth.sides[wesnoth.current.side].recruit) do
if not efficiency[recruit_id] then
-- Recruit list changed since last recruit, recalculate efficiency
efficiency = get_hp_efficiency()
self.data.recruit.hp_efficiency = efficiency
end
-- Count number of units with the same attack type. Used to avoid recruiting too many of the same unit
local attack_types = 0
local recruit_count = 0