additionally rate limit villager jobhunts

This commit is contained in:
cora 2022-06-16 15:53:08 +02:00
parent e630ea59c9
commit cd43076ea3
1 changed files with 2 additions and 0 deletions

View File

@ -613,6 +613,8 @@ local function employ(self,jobsite_pos)
end
local function look_for_job(self)
if self.last_jobhunt and os.time() - self.last_jobhunt < 360 then return end
self.last_jobhunt = os.time() + math.random(0,60)
local p = self.object:get_pos()
local nn = minetest.find_nodes_in_area(vector.offset(p,-48,-48,-48),vector.offset(p,48,48,48),jobsites)
for _,n in pairs(nn) do