Skip to content

Commit

Permalink
Abort if static_spawnpoint is an invalid setting instead of just givi…
Browse files Browse the repository at this point in the history
…ng an error log
  • Loading branch information
HybridDog authored and rubenwardy committed Aug 12, 2017
1 parent 3aab517 commit 7e23532
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions builtin/game/static_spawn.lua
@@ -1,15 +1,13 @@
-- Minetest: builtin/static_spawn.lua

local function warn_invalid_static_spawnpoint()
if core.settings:get("static_spawnpoint") and
not core.setting_get_pos("static_spawnpoint") then
core.log("error", "The static_spawnpoint setting is invalid: \""..
core.settings:get("static_spawnpoint").."\"")
end
local static_spawnpoint_string = core.settings:get("static_spawnpoint")
if static_spawnpoint_string and
static_spawnpoint_string ~= "" and
not core.setting_get_pos("static_spawnpoint") then
error('The static_spawnpoint setting is invalid: "' ..
static_spawnpoint_string .. '"')
end

warn_invalid_static_spawnpoint()

local function put_player_in_spawn(player_obj)
local static_spawnpoint = core.setting_get_pos("static_spawnpoint")
if not static_spawnpoint then
Expand Down

0 comments on commit 7e23532

Please sign in to comment.