Fixed that players would not be correctly moved.
parent
66eafdfa8c
commit
9dac4face1
|
@ -139,6 +139,10 @@
|
||||||
<td class="summary">If the system is currently scheduled for execution.</td>
|
<td class="summary">If the system is currently scheduled for execution.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="name" nowrap><a href="#spawnpoint">spawnpoint</a></td>
|
||||||
|
<td class="summary">The spawnpoint that is configured.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="name" nowrap><a href="#spawnpoint_providers">spawnpoint_providers</a></td>
|
<td class="name" nowrap><a href="#spawnpoint_providers">spawnpoint_providers</a></td>
|
||||||
<td class="summary">The registered spawnpoint providers.</td>
|
<td class="summary">The registered spawnpoint providers.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -493,6 +497,20 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt>
|
||||||
|
<a name = "spawnpoint"></a>
|
||||||
|
<strong>spawnpoint</strong>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
The spawnpoint that is configured.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt>
|
<dt>
|
||||||
<a name = "spawnpoint_providers"></a>
|
<a name = "spawnpoint_providers"></a>
|
||||||
|
|
|
@ -69,6 +69,13 @@ spawnusher = {
|
||||||
--- If the system is currently scheduled for execution.
|
--- If the system is currently scheduled for execution.
|
||||||
scheduled = false,
|
scheduled = false,
|
||||||
|
|
||||||
|
--- The spawnpoint that is configured.
|
||||||
|
spawnpoint = settings.get_pos("static_spawnpoint", {
|
||||||
|
x = 0,
|
||||||
|
y = 0,
|
||||||
|
z = 0
|
||||||
|
}),
|
||||||
|
|
||||||
--- The registered spawnpoint providers.
|
--- The registered spawnpoint providers.
|
||||||
spawnpoint_providers = List:new()
|
spawnpoint_providers = List:new()
|
||||||
}
|
}
|
||||||
|
@ -246,21 +253,13 @@ function spawnusher.on_spawn_player(player)
|
||||||
player:set_physics_override(spawnusher.physics_override)
|
player:set_physics_override(spawnusher.physics_override)
|
||||||
|
|
||||||
-- Move the player to the set/default spawn point.
|
-- Move the player to the set/default spawn point.
|
||||||
local spawn_pos = minetest.setting_get_pos("static_spawnpoint")
|
player:setpos(spawnusher.spawnpoint)
|
||||||
if spawn_pos == nil then
|
|
||||||
spawn_pos = {
|
|
||||||
x = 0,
|
|
||||||
y = 0,
|
|
||||||
z = 0
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Move the player randomly afterwards.
|
-- Move the player randomly afterwards.
|
||||||
spawnusher.move_random(player)
|
spawnusher.move_random(player)
|
||||||
|
|
||||||
player:setpos(spawn_pos)
|
|
||||||
|
|
||||||
local exact_pos = false
|
local exact_pos = false
|
||||||
|
local spawn_pos = player:getpos()
|
||||||
|
|
||||||
-- Run the position through the providers.
|
-- Run the position through the providers.
|
||||||
spawnusher.spawnpoint_providers:foreach(function(provider, index)
|
spawnusher.spawnpoint_providers:foreach(function(provider, index)
|
||||||
|
|
Loading…
Reference in New Issue