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:
parent
4d67102e7a
commit
c7c91fde55
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue