Skip to content
Permalink
Browse files

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

  • Loading branch information...
paramat committed Oct 14, 2018
1 parent b042106 commit 382e2acd9b4320866d2bfdc29dd5e122bcb54994
Showing with 12 additions and 0 deletions.
  1. +1 −0 mods/spawn/depends.txt
  2. +11 −0 mods/spawn/init.lua
@@ -1 +1,2 @@
default
beds?
@@ -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

0 comments on commit 382e2ac

Please sign in to comment.
You can’t perform that action at this time.