villagers only get a job when they touch jobsite

This commit is contained in:
cora 2022-07-03 21:51:42 +02:00
parent 21d5ab88a5
commit dd5e9afbd9

View File

@ -631,10 +631,8 @@ end
local function get_a_job(self)
local p = self.object:get_pos()
local nn = minetest.find_nodes_in_area(vector.offset(p,-8,-8,-8),vector.offset(p,8,8,8),jobsites)
for _,n in pairs(nn) do
if n and employ(self,n) then return true end
end
local n = minetest.find_node_near(p,1,jobsites)
if n and employ(self,n) then return true end
if self.state ~= "gowp" then look_for_job(self) end
end