aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorHybrid Dog <ovvv@web.de>2017-08-12 12:11:28 +0200
committerrubenwardy <rubenwardy@gmail.com>2017-08-12 19:37:53 +0100
commit7e23532bc2982fe8c3b23eb8f3b536184b43021f (patch)
tree2e8060278da4bdff0894cc8afde442ce78252428 /builtin/game
parent3aab517775d1095f9f24c17b6e880dffd372e3ef (diff)
downloadminetest-7e23532bc2982fe8c3b23eb8f3b536184b43021f.tar.gz
minetest-7e23532bc2982fe8c3b23eb8f3b536184b43021f.tar.bz2
minetest-7e23532bc2982fe8c3b23eb8f3b536184b43021f.zip
Abort if static_spawnpoint is an invalid setting instead of just giving an error log
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/static_spawn.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/builtin/game/static_spawn.lua b/builtin/game/static_spawn.lua
index b1157b42e..2a5d9b1fa 100644
--- a/builtin/game/static_spawn.lua
+++ b/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