From: Paramat Date: Sun, 14 Oct 2018 01:36:40 +0000 (+0100) Subject: Spawn mod: Avoid respawn conflict with beds mod (#2240) X-Git-Tag: 5.0.0~29 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=382e2acd9b4320866d2bfdc29dd5e122bcb54994;p=oweals%2Fminetest_game.git Spawn mod: Avoid respawn conflict with beds mod (#2240) --- diff --git a/mods/spawn/depends.txt b/mods/spawn/depends.txt index 4ad96d51..548489e2 100644 --- a/mods/spawn/depends.txt +++ b/mods/spawn/depends.txt @@ -1 +1,2 @@ default +beds? diff --git a/mods/spawn/init.lua b/mods/spawn/init.lua index dc6366c1..6707932c 100644 --- a/mods/spawn/init.lua +++ b/mods/spawn/init.lua @@ -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