mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-23 02:51:06 +01:00
Merge pull request 'Remove settlements_in_world
and settlements.txt
' (#2094) from villages-fixes into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2094
This commit is contained in:
commit
f807ac5c70
4 changed files with 0 additions and 33 deletions
|
@ -93,10 +93,6 @@ function settlements.create_site_plan(maxp, minp, pr)
|
||||||
-- go build settlement around center
|
-- go build settlement around center
|
||||||
if not center_surface then return false end
|
if not center_surface then return false end
|
||||||
|
|
||||||
-- add settlement to list
|
|
||||||
table.insert(settlements_in_world, center_surface)
|
|
||||||
-- save list to file
|
|
||||||
settlements.save()
|
|
||||||
-- initialize all settlement_info table
|
-- initialize all settlement_info table
|
||||||
local count_buildings, number_of_buildings, number_built = settlements.initialize_settlement_info(pr)
|
local count_buildings, number_of_buildings, number_built = settlements.initialize_settlement_info(pr)
|
||||||
-- first building is townhall in the center
|
-- first building is townhall in the center
|
||||||
|
|
|
@ -65,11 +65,6 @@ settlements.schematic_table = {
|
||||||
{name = "well", mts = schem_path.."well.mts", hwidth = 6, hdepth = 8, hheight = 6, hsize = 10, max_num = 0.045, rplc = basic_pseudobiome_villages },
|
{name = "well", mts = schem_path.."well.mts", hwidth = 6, hdepth = 8, hheight = 6, hsize = 10, max_num = 0.045, rplc = basic_pseudobiome_villages },
|
||||||
}
|
}
|
||||||
|
|
||||||
--
|
|
||||||
-- list of settlements, load on server start up
|
|
||||||
--
|
|
||||||
settlements_in_world = {}
|
|
||||||
--
|
|
||||||
--
|
--
|
||||||
-- maximum allowed difference in height for building a sttlement
|
-- maximum allowed difference in height for building a sttlement
|
||||||
--
|
--
|
||||||
|
|
|
@ -10,7 +10,6 @@ dofile(settlements.modpath.."/paths.lua")
|
||||||
--
|
--
|
||||||
-- load settlements on server
|
-- load settlements on server
|
||||||
--
|
--
|
||||||
settlements_in_world = settlements.load()
|
|
||||||
settlements.grundstellungen()
|
settlements.grundstellungen()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -88,29 +88,6 @@ function settlements.check_distance(settlement_info, building_pos, building_size
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- save list of generated settlements
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
function settlements.save()
|
|
||||||
local file = io.open(minetest.get_worldpath().."/settlements.txt", "w")
|
|
||||||
if file then
|
|
||||||
file:write(minetest.serialize(settlements_in_world))
|
|
||||||
file:close()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
-- load list of generated settlements
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
function settlements.load()
|
|
||||||
local file = io.open(minetest.get_worldpath().."/settlements.txt", "r")
|
|
||||||
if file then
|
|
||||||
local table = minetest.deserialize(file:read("*all"))
|
|
||||||
if type(table) == "table" then
|
|
||||||
return table
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
-- fill chests
|
-- fill chests
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
function settlements.fill_chest(pos, pr)
|
function settlements.fill_chest(pos, pr)
|
||||||
|
|
Loading…
Reference in a new issue