World Conquest: Fix for Winged Scepter bug

The Winged Scepter item will now grant flight movement and defences as stated in the description (and not just movement as it did before).
This commit is contained in:
Tahsin Jahin Khalid 2022-01-11 16:12:07 +06:00
parent fdfce55d1a
commit 165f2cfb40

View file

@ -93,7 +93,7 @@ function wesnoth.effects.wc2_min_defense(u, cfg)
local defense_new = {}
local defense_old = wml.parsed(wml.get_child(cfg, "defense"))
for k,v in pairs(defense_old) do
if type(k) == "string" and type(v) == "number" and wesnoth.units.defense_on(u, terrain_map[k] or "") >= v then
if type(k) == "string" and type(v) == "number" and wesnoth.units.chance_to_be_hit(u, terrain_map[k] or "") >= v then
defense_new[k] = v
end
end