Skip to content

Commit 382e2ac

Browse files
authoredOct 14, 2018
Spawn mod: Avoid respawn conflict with beds mod (#2240)
1 parent b042106 commit 382e2ac

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎mods/spawn/depends.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
default
2+
beds?

‎mods/spawn/init.lua

+11
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,18 @@ minetest.register_on_newplayer(function(player)
126126
on_spawn(player)
127127
end)
128128

129+
local enable_bed_respawn = minetest.settings:get_bool("enable_bed_respawn")
130+
if enable_bed_respawn == nil then
131+
enable_bed_respawn = true
132+
end
133+
129134
minetest.register_on_respawnplayer(function(player)
135+
-- Avoid respawn conflict with beds mod
136+
if beds and enable_bed_respawn and
137+
beds.spawn[player:get_player_name()] then
138+
return
139+
end
140+
130141
on_spawn(player)
131142

132143
return true

0 commit comments

Comments
 (0)
Please sign in to comment.