forked from VoxeLibre/VoxeLibre
villagers only get a job when they touch jobsite
This commit is contained in:
parent
21d5ab88a5
commit
dd5e9afbd9
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue