mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-08 20:12:11 +00:00
Misc fixes
- Prevent players from falling through the barrier before the match starts - Prevent the server from crashing if you try to start a non-existant map
This commit is contained in:
parent
1b4903fe22
commit
2c09090a91
4 changed files with 61 additions and 32 deletions
|
|
@ -1,11 +1,13 @@
|
|||
-- Maps mod for SSG
|
||||
function place_map(map)
|
||||
local map_path = core.get_modpath("maps") .. "/maps/"
|
||||
local map_data = dofile(map_path .. map .. "/map.lua")
|
||||
local barrier_nodes = {}
|
||||
local map_path = core.get_modpath("maps") .. "/maps/" .. map .. "/"
|
||||
|
||||
|
||||
core.place_schematic({x=0, y=0, z=0}, map_path .. map .. "/map.mts", 0, nil, true)
|
||||
if not core.path_exists(map_path) then
|
||||
return "nope :("
|
||||
end
|
||||
|
||||
local map_data = dofile(map_path .. "map.lua")
|
||||
core.place_schematic({x=0, y=0, z=0}, map_path .. "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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue