Skip to content

Commit

Permalink
More deprecated stuff replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Feb 22, 2021
1 parent 5cbe292 commit 0c1c0d3
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions data/campaigns/World_Conquest/lua/map/generator/utilities.lua
Expand Up @@ -246,12 +246,12 @@ function default_generate_map(data)
for i = 1, 20 do
local status, map = pcall(function()
cfg.seed = wesnoth.random(5000) + 7
return wesnoth.generate_default_map(w, h, cfg)
return wesnoth.map.generate(w, h, cfg)
end)
if status then
return map
end
end
cfg.seed = wesnoth.random(5000) + 7
return wesnoth.generate_default_map(w, h, cfg)
return wesnoth.map.generate(w, h, cfg)
end
Expand Up @@ -5,7 +5,7 @@ local function wct_conect_factory_rails()
f.terrain("*^Br*"),
f.adjacent(f.terrain("*^Vhh"))
))
while #map:get_locations(wesnoth.create_filter(
while #map:get_locations(wesnoth.map.filter(
f.all(
f.terrain("*^Br*"),
f.adjacent(f.find_in("rails_conected")),
Expand Down Expand Up @@ -55,7 +55,7 @@ local function wct_conect_factory_rails()
filter_extra = { rails_conected = rails_conected },
layer = "overlay",
}
rails_conected = map:get_locations(wesnoth.create_filter(
rails_conected = map:get_locations(wesnoth.map.filter(
f.all(
f.terrain("*^Br*"),
f.radius(1, f.find_in("rails_conected"))
Expand Down
Expand Up @@ -135,12 +135,12 @@ local function world_conquest_tek_map_repaint_6d()
-- this is faster.
local r8_Re = map:get_tiles_radius(
map:get_locations(f.terrain("Re")),
wesnoth.create_filter(f.all()),
wesnoth.map.filter(f.all()),
8
)
local r6_Khs = map:get_tiles_radius(
map:get_locations(f.terrain("Khs")),
wesnoth.create_filter(f.all()),
wesnoth.map.filter(f.all()),
6
)
set_terrain { "Chs",
Expand Down
Expand Up @@ -37,7 +37,7 @@ f = {
}

function get_locations(t)
local filter = wesnoth.create_filter(t.filter, t.filter_extra or {})
local filter = wesnoth.map.filter(t.filter, t.filter_extra or {})
return map:get_locations(filter, t.locs)
end

Expand All @@ -46,7 +46,7 @@ function set_terrain_impl(data)
local nlocs_total = 0
for i = 1, #data do
if data[i].filter then
local f = wesnoth.create_filter(data[i].filter, data[i].known or {})
local f = wesnoth.map.filter(data[i].filter, data[i].known or {})
locs[i] = map:get_locations(f, data[i].locs)
else
locs[i] = data[i].locs
Expand Down
Expand Up @@ -111,8 +111,8 @@ function wct_castle_expansion_side(side_num)
if keep_loc == nil then
return
end
local castle = map:get_tiles_radius({keep_loc}, wesnoth.create_filter(f.terrain("C*,K*")), 1)
local keep_area = map:get_tiles_radius({keep_loc}, wesnoth.create_filter(f.all()), 2)
local castle = map:get_tiles_radius({keep_loc}, wesnoth.map.filter(f.terrain("C*,K*")), 1)
local keep_area = map:get_tiles_radius({keep_loc}, wesnoth.map.filter(f.all()), 2)

local candidates = get_locations {
filter = f.all(
Expand Down Expand Up @@ -166,7 +166,7 @@ function get_oceanic()
f.y("1," .. tostring(map.height - 1))
)
local water_border_tiles = map:get_locations(f.all(f_is_border, f.terrain("Wo*")))
local filter_radius = wesnoth.create_filter(f.all(
local filter_radius = wesnoth.map.filter(f.all(
f.terrain("W*^V*,Wwr*,Ww,Wwg,Wwt,Wo*"),
--ignore rivers
f.adjacent(f.terrain("!,W*^*,S*^*,D*^*,Ai"), nil, "0-3")
Expand Down
@@ -1,6 +1,6 @@
function world_conquest_tek_map_noise_proxy(radius, fraction, terrain)
local terrain_to_change = map:get_locations(f.terrain(terrain))
local nop_filter = wesnoth.create_filter(f.all())
local nop_filter = wesnoth.map.filter(f.all())
helper.shuffle(terrain_to_change)
for terrain_i = 1, math.ceil(#terrain_to_change / fraction) do
local loc_a = terrain_to_change[terrain_i]
Expand Down
Expand Up @@ -249,7 +249,7 @@ end
function wct_iterate_roads_to_2(f_validpath, f_src, f_dest, terrain_road, radius)
local src_tiles = map:get_locations(f_src)
local dest_tiles = map:get_locations(f_dest)
local filter_path = wesnoth.create_filter(f_validpath)
local filter_path = wesnoth.map.filter(f_validpath)
local map = _G.map

local function filter_path_function(x, y)
Expand Down
Expand Up @@ -676,7 +676,7 @@ local function river_to_lava_postfix(terrain_to_change)
}

wild_volcano_for_lava_zone(terrain_to_change)
local filter_adjacent_grassland = wesnoth.create_filter(f.all(
local filter_adjacent_grassland = wesnoth.map.filter(f.all(
f.terrain("G*^*"),
f.adjacent(f.find_in("terrain_to_change"))
), { terrain_to_change = terrain_to_change })
Expand Down
Expand Up @@ -162,7 +162,7 @@ function wct_bonus_chose_scenery(loc, theme, filter_extra)
::intial_list_screated::

local function matches_location(f)
local filter_object = wesnoth.create_filter(f, filter_extra)
local filter_object = wesnoth.map.filter(f, filter_extra)
return #map:get_locations(filter_object, {loc}) > 0
end

Expand Down Expand Up @@ -401,7 +401,7 @@ function world_conquest_tek_bonus_points(theme)
local res = {}
local scenario_num = wesnoth.get_variable("wc2_scenario") or 1
oceanic = get_oceanic()
f_wct_bonus_location_filter = wesnoth.create_filter(get_f_wct_bonus_location_filter(map), { oceanic = oceanic })
f_wct_bonus_location_filter = wesnoth.map.filter(get_f_wct_bonus_location_filter(map), { oceanic = oceanic })
local possible_locs = map:get_locations(f_wct_bonus_location_filter)
function place_item(loc)
scenery = wct_bonus_chose_scenery(loc, theme, { oceanic = oceanic })
Expand Down
Expand Up @@ -44,7 +44,7 @@ local function run_postgeneration(map_data, id, scenario_content, nplayers, nhum
nhumanplayers = nhumanplayer,
scenario = scenario_content,
}
_G.map = wesnoth.create_map(map_data)
_G.map = wesnoth.map.create(map_data)
_G.total_tiles = _G.map.width * _G.map.height
_G.prestart_event = scenario_content.event[1]
_G.print_time = function(msg)
Expand Down

0 comments on commit 0c1c0d3

Please sign in to comment.