Make villagers homeless when bed is gone on return

This commit is contained in:
cora 2022-05-09 11:57:51 +02:00 committed by Gitea
parent 8d0afede37
commit 12a943e222

View File

@ -946,6 +946,10 @@ local function go_home(entity)
if vector.distance(b,s) < 10 then if vector.distance(b,s) < 10 then
entity.state = "stand" entity.state = "stand"
set_velocity(entity,0) set_velocity(entity,0)
local n=minetest.get_node(b)
if n and n.name ~= "mcl_beds:bed_red_bottom" then
entity.bed=nil --bed is gone, make villager homeless
end
end end
end end