Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Spawn mod: Avoid respawn conflict with beds mod (#2240)
  • Loading branch information
paramat committed Oct 14, 2018
1 parent b042106 commit 382e2ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions mods/spawn/depends.txt
@@ -1 +1,2 @@
default
beds?
11 changes: 11 additions & 0 deletions mods/spawn/init.lua
Expand Up @@ -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
Expand Down

0 comments on commit 382e2ac

Please sign in to comment.