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
1 changed files with 2 additions and 4 deletions

View File

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