Fix crash when new player rightclicks a bed
This commit is contained in:
parent
4e9190bbcf
commit
dbef60c558
|
@ -459,10 +459,12 @@ function mcl_spawn.set_spawn_pos(player, pos, message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local old_bed_meta = minetest.get_meta(oldpos)
|
if oldpos and oldpos ~= pos then
|
||||||
if oldpos ~= pos and old_bed_meta then
|
local old_bed_meta = minetest.get_meta(oldpos)
|
||||||
mcl_log("Removing old bed meta")
|
if old_bed_meta then
|
||||||
old_bed_meta:set_string("player", "")
|
mcl_log("Removing old bed meta")
|
||||||
|
old_bed_meta:set_string("player", "")
|
||||||
|
end
|
||||||
else
|
else
|
||||||
mcl_log("No old bed meta to remove or same as current")
|
mcl_log("No old bed meta to remove or same as current")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user