mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
Reset spawn position on bed destruction
This commit is contained in:
parent
eac4795326
commit
176ddba176
@ -17,6 +17,8 @@ local function destruct_bed(pos, n)
|
|||||||
reverse = not reverse
|
reverse = not reverse
|
||||||
minetest.remove_node(other)
|
minetest.remove_node(other)
|
||||||
minetest.check_for_falling(other)
|
minetest.check_for_falling(other)
|
||||||
|
beds.remove_spawns_at(pos)
|
||||||
|
beds.remove_spawns_at(other)
|
||||||
else
|
else
|
||||||
reverse = not reverse
|
reverse = not reverse
|
||||||
end
|
end
|
||||||
|
@ -61,3 +61,12 @@ function beds.set_spawns()
|
|||||||
end
|
end
|
||||||
beds.save_spawns()
|
beds.save_spawns()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function beds.remove_spawns_at(pos)
|
||||||
|
for name, p in pairs(beds.spawn) do
|
||||||
|
if vector.equals(vector.round(p), pos) then
|
||||||
|
beds.spawn[name] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
beds.save_spawns()
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user