Remove remaining uses of wesnoth.special_locations

This commit is contained in:
Hejnewar 2021-05-10 11:26:12 +02:00
parent e1a79988b4
commit 16c8fcc49c
3 changed files with 3 additions and 3 deletions

View File

@ -655,7 +655,7 @@ function ai_helper.get_named_loc_xy(param_core, cfg, required_for)
if (param_core ~= '') then param_loc = param_core .. '_loc' end
local loc_id = cfg[param_loc]
if loc_id then
local loc = wesnoth.special_locations[loc_id]
local loc = wesnoth.current.map.special_locations[loc_id]
if loc then
return loc
else

View File

@ -684,7 +684,7 @@ return {
local enemy_sides = wesnoth.sides.find({ { "enemy_of", {side = wesnoth.current.side} } })
local min_dist = math.huge
for _, side in ipairs(enemy_sides) do
local enemy_start_hex = wesnoth.special_locations[side.side]
local enemy_start_hex = wesnoth.current.map.special_locations[side.side]
if enemy_start_hex then
local dist = wesnoth.map.distance_between(reference_hex[1], reference_hex[2], enemy_start_hex[1], enemy_start_hex[2])
if dist < min_dist then

View File

@ -4,7 +4,7 @@ local function path_locs(path)
local function special_locations()
return function()
for _,loc in ipairs(tostring(path.location_id):split()) do
loc = wesnoth.special_locations[loc]
loc = wesnoth.current.map.special_locations[loc]
if loc then coroutine.yield(loc[1], loc[2]) end
end
end