Lua API: Use the new location_set complement in the place_shroud deprecation wrapper

This commit is contained in:
Celtic Minstrel 2021-07-27 23:52:13 -04:00 committed by Celtic Minstrel
parent 300b4492b8
commit 44da16d66a

View File

@ -50,14 +50,8 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then
wesnoth.sides.override_shroud(side, {})
else
local ls = wesnoth.require "location_set"
local clear = ls.of_shroud_data(shroud)
shroud = ls.create()
for x,y in wesnoth.current.map:iter() do
if not clear(x,y) then
shroud:insert(x,y)
end
end
wesnoth.sides.place_shroud(side, shroud:to_pairs())
shroud = ls.of_shroud_data(shroud)
wesnoth.sides.place_shroud(side, (~shroud):to_pairs())
end
else
wesnoth.sides.place_shroud(side, shroud)