Spawn mod: Avoid respawn conflict with beds mod (#2240)

This commit is contained in:
Paramat 2018-10-14 02:36:40 +01:00 committed by GitHub
parent b042106fdc
commit 382e2acd9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -1 +1,2 @@
default
beds?

View File

@ -126,7 +126,18 @@ minetest.register_on_newplayer(function(player)
on_spawn(player)
end)
local enable_bed_respawn = minetest.settings:get_bool("enable_bed_respawn")
if enable_bed_respawn == nil then
enable_bed_respawn = true
end
minetest.register_on_respawnplayer(function(player)
-- Avoid respawn conflict with beds mod
if beds and enable_bed_respawn and
beds.spawn[player:get_player_name()] then
return
end
on_spawn(player)
return true