diff --git a/doc/index.html b/doc/index.html index 19f19d1..86200b8 100644 --- a/doc/index.html +++ b/doc/index.html @@ -139,6 +139,10 @@ If the system is currently scheduled for execution. + spawnpoint + The spawnpoint that is configured. + + spawnpoint_providers The registered spawnpoint providers. @@ -493,6 +497,20 @@ + +
+ + spawnpoint +
+
+ The spawnpoint that is configured. + + + + + + +
diff --git a/mods/spawn_usher/spawnusher.lua b/mods/spawn_usher/spawnusher.lua index 020b068..021a675 100644 --- a/mods/spawn_usher/spawnusher.lua +++ b/mods/spawn_usher/spawnusher.lua @@ -69,6 +69,13 @@ spawnusher = { --- If the system is currently scheduled for execution. scheduled = false, + --- The spawnpoint that is configured. + spawnpoint = settings.get_pos("static_spawnpoint", { + x = 0, + y = 0, + z = 0 + }), + --- The registered spawnpoint providers. spawnpoint_providers = List:new() } @@ -246,21 +253,13 @@ function spawnusher.on_spawn_player(player) player:set_physics_override(spawnusher.physics_override) -- Move the player to the set/default spawn point. - local spawn_pos = minetest.setting_get_pos("static_spawnpoint") - if spawn_pos == nil then - spawn_pos = { - x = 0, - y = 0, - z = 0 - } - end + player:setpos(spawnusher.spawnpoint) -- Move the player randomly afterwards. spawnusher.move_random(player) - player:setpos(spawn_pos) - local exact_pos = false + local spawn_pos = player:getpos() -- Run the position through the providers. spawnusher.spawnpoint_providers:foreach(function(provider, index)