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:
parent
b57dd0f9b2
commit
da0cc7f6f6
2 changed files with 44 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue