Skip to content

Commit 7e23532

Browse files
HybridDogrubenwardy
authored andcommittedAug 12, 2017
Abort if static_spawnpoint is an invalid setting instead of just giving an error log
1 parent 3aab517 commit 7e23532

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed
 

‎builtin/game/static_spawn.lua

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
-- Minetest: builtin/static_spawn.lua
22

3-
local function warn_invalid_static_spawnpoint()
4-
if core.settings:get("static_spawnpoint") and
5-
not core.setting_get_pos("static_spawnpoint") then
6-
core.log("error", "The static_spawnpoint setting is invalid: \""..
7-
core.settings:get("static_spawnpoint").."\"")
8-
end
3+
local static_spawnpoint_string = core.settings:get("static_spawnpoint")
4+
if static_spawnpoint_string and
5+
static_spawnpoint_string ~= "" and
6+
not core.setting_get_pos("static_spawnpoint") then
7+
error('The static_spawnpoint setting is invalid: "' ..
8+
static_spawnpoint_string .. '"')
99
end
1010

11-
warn_invalid_static_spawnpoint()
12-
1311
local function put_player_in_spawn(player_obj)
1412
local static_spawnpoint = core.setting_get_pos("static_spawnpoint")
1513
if not static_spawnpoint then

0 commit comments

Comments
 (0)
Please sign in to comment.