Update deprecated lua

This commit is contained in:
Gunter Labes 2021-06-20 20:57:46 +02:00
parent 1cacd12a89
commit 5fe043c288
No known key found for this signature in database
GPG key ID: C0C7B971CC910216

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.unit_defense(u, terrain_map[k] or "") >= v then
if type(k) == "string" and type(v) == "number" and wesnoth.units.defense_on(u, terrain_map[k] or "") >= v then
defense_new[k] = v
end
end