aboutsummaryrefslogtreecommitdiff
path: root/assets/signal_wall.blend
blob: 6927aa57145c35aa37cba0a4865ca4a626355914 (plain)
blob size (500KB) exceeds display size limit (100KB).
id='n14' href='#n14'>14 15 16 17 18 19 20 21 22 23 24 25
-- Minetest: builtin/static_spawn.lua

local function warn_invalid_static_spawnpoint()
	if core.setting_get("static_spawnpoint") and
			not core.setting_get_pos("static_spawnpoint") then
		core.log("error", "The static_spawnpoint setting is invalid: \""..
				core.setting_get("static_spawnpoint").."\"")
	end
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
		return false
	end
	core.log("action", "Moving " .. player_obj:get_player_name() ..
		" to static spawnpoint at " .. core.pos_to_string(static_spawnpoint))
	player_obj:setpos(static_spawnpoint)
	return true
end

core.register_on_newplayer(put_player_in_spawn)
core.register_on_respawnplayer(put_player_in_spawn)