mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
additionally rate limit villager jobhunts
This commit is contained in:
parent
e630ea59c9
commit
cd43076ea3
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue