From 382e2acd9b4320866d2bfdc29dd5e122bcb54994 Mon Sep 17 00:00:00 2001 From: Paramat Date: Sun, 14 Oct 2018 02:36:40 +0100 Subject: [PATCH] Spawn mod: Avoid respawn conflict with beds mod (#2240) --- mods/spawn/depends.txt | 1 + mods/spawn/init.lua | 11 +++++++++++ 2 files changed, 12 insertions(+) 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 -- 2.25.1