1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-29 21:30:26 +02:00

Beds: priv/griefing fixes.

- disallow placing beds in protected areas
- fix rotation of beds(broken after 41c2b2ae)
- allow using others' beds, but don't change spawn location

Fixes #953. #943 isn't something I think was ever implemented, and
this does a fair job of addressing the main concern (spawning in
others' houses)
This commit is contained in:
Auke Kok
2016-03-18 18:55:56 -07:00
committed by paramat
parent b57dd0f9b2
commit da0cc7f6f6
2 changed files with 44 additions and 21 deletions

View File

@ -18,8 +18,8 @@ function beds.read_spawns()
repeat
local x = input:read("*n")
if x == nil then
break
end
break
end
local y = input:read("*n")
local z = input:read("*n")
local name = input:read("*l")
@ -52,7 +52,10 @@ function beds.set_spawns()
for name,_ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
local p = player:getpos()
beds.spawn[name] = p
-- but don't change spawn location if borrowing a bed
if not minetest.is_protected(p, name) then
beds.spawn[name] = p
end
end
beds.save_spawns()
end