Map maker: Add support for optionally specifying base node

This commit is contained in:
ANAND 2019-10-09 11:46:51 +05:30
parent 31ba4286fe
commit c4e3683071
3 changed files with 4 additions and 2 deletions

View file

@ -64,6 +64,7 @@ Each map's metadata is stored in an accompanying .conf file containing the follo
* `author`: Author of the map.
* `hint`: [Optional] Helpful hint or tip for unique maps, to help players understand the map.
* `rotation`: Rotation of the schem. [`x`|`z`]
* `base_node`: [Optional] Technical name of node to be used for the team base.
* `schematic`: Name of the map's schematic.
* `initial_stuff`: [Optional] Comma-separated list of itemstacks to be given to the player
on join and on respawn.

View file

@ -2,8 +2,8 @@ function ctf_map.place_base(color, pos)
-- Spawn ind base
for x = pos.x - 2, pos.x + 2 do
for z = pos.z - 2, pos.z + 2 do
minetest.set_node({ x = x, y = pos.y - 1, z = z},
{name = "ctf_map:ind_cobble"})
minetest.set_node({ x = x, y = pos.y - 1, z = z },
{ name = ctf_map.map.base_node or "ctf_map:ind_cobble" })
end
end

View file

@ -100,6 +100,7 @@ local function load_map_meta(idx, path)
screenshot = meta:get("screenshot"),
license = meta:get("license"),
others = meta:get("others"),
base_node = meta:get("base_node"),
schematic = path .. ".mts",
initial_stuff = initial_stuff and initial_stuff:split(","),
treasures = treasures,