mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-13 13:26:06 +00:00
Fix the barriers being offset by 2
Also add more dependency mods
This commit is contained in:
parent
e07ccacd4f
commit
a36d522b2e
188 changed files with 7334 additions and 14 deletions
|
|
@ -1,16 +1,10 @@
|
|||
function place_map(map)
|
||||
local map_path = core.get_modpath("maps") .. "/maps/"
|
||||
local map_data = dofile(map_path .. map .. "/map.lua")
|
||||
local barrier_nodes = {}
|
||||
|
||||
|
||||
for x = 1, map_data.size_x do -- preset the area to air to avoid any problems with preexisting maps
|
||||
for y = 1, map_data.size_y do
|
||||
for z = 1, map_data.size_z do
|
||||
core.set_node({x=x-1, y=y-1, z=z-1}, {name = "air"}) -- maybe switch to core.bulk_set_node()?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
core.place_schematic({x=0, y=0, z=0}, map_path .. map .. "/map.mts", 0, nil, false)
|
||||
core.place_schematic({x=0, y=0, z=0}, map_path .. map .. "/map.mts", 0, nil, true)
|
||||
|
||||
if map_data.spawn_x == nil or map_data.spawn_y == nil or map_data.spawn_z == nil then -- set a default spawnpoint if not set
|
||||
map_data.spawn_x = map_data.size_x / 2
|
||||
|
|
@ -22,9 +16,9 @@ function place_map(map)
|
|||
end
|
||||
|
||||
function remove_barrier(x, y, z)
|
||||
for node_x = 1, x do
|
||||
for node_z = 1, z do
|
||||
core.set_node({x = node_x - 1, y = y - 1, z = node_z - 1}, {name = "air"}) -- account for the fact that lua counts starting at 1... i think.... whatever, it works \_('_')_/
|
||||
for node_x = 1, x - 2 do
|
||||
for node_z = 1, z - 2 do
|
||||
core.set_node({x = node_x, y = y - 1, z = node_z}, {name = "air"}) -- account for the fact that lua counts starting at 1... i think.... whatever, it works \_('_')_/
|
||||
end
|
||||
end
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue