mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +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
|
end
|
||||||
|
|
||||||
local function look_for_job(self)
|
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 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)
|
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
|
for _,n in pairs(nn) do
|
||||||
|
|
Loading…
Reference in a new issue