mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-24 00:49:34 +01:00
Make villagers homeless when bed is gone on return
This commit is contained in:
parent
8d0afede37
commit
12a943e222
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue