Merge pull request 'Fix crash when new player rightclicks a bed' (#2958) from fix_bed_meta_crash into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2958 Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me> Reviewed-by: PrairieWind <prairie.astronomer1@gmail.com>mcl-craftguide-drop-sfinv
commit
ebd38fd44e
|
@ -459,10 +459,12 @@ function mcl_spawn.set_spawn_pos(player, pos, message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if oldpos and oldpos ~= pos then
|
||||||
local old_bed_meta = minetest.get_meta(oldpos)
|
local old_bed_meta = minetest.get_meta(oldpos)
|
||||||
if oldpos ~= pos and old_bed_meta then
|
if old_bed_meta then
|
||||||
mcl_log("Removing old bed meta")
|
mcl_log("Removing old bed meta")
|
||||||
old_bed_meta:set_string("player", "")
|
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