diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 5742ebb85..ad390b9ff 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -2614,8 +2614,7 @@ local function check_gowp(self,dtime) elseif self.current_target then -- No waypoints left, but have current target. Potentially last waypoint to go to. - mcl_log("self.current_target: ".. minetest.pos_to_string(self.current_target)) - mcl_log("pos: ".. minetest.pos_to_string(p)) + mcl_log("pos: ".. minetest.pos_to_string(p) .. "self.current_target: ".. minetest.pos_to_string(self.current_target)) go_to_pos(self,self.current_target) -- Do i just delete current_target, and return so we can find final path. else @@ -2644,10 +2643,10 @@ local function check_gowp(self,dtime) -- 1.6 is good. is 1.9 better? It could fail less, but will it path to door when it isn't after door if distance_to_cur_targ > 1.9 then - mcl_log("no LOS to target: ".. minetest.pos_to_string(self.current_target)) + mcl_log("not close to current target: ".. minetest.pos_to_string(self.current_target)) go_to_pos(self,self._current_target) else - mcl_log("Let's go to target: ".. minetest.pos_to_string(self.current_target)) + mcl_log("close to current target: ".. minetest.pos_to_string(self.current_target)) self.current_target = nil --go_to_pos(self,self._target) self.waypoints=minetest.find_path(updated_p,self._target,150,1,4) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index a80c4e78f..f5bb599ea 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -952,7 +952,7 @@ local function validate_jobsite(self) end local function do_work (self) - debug_trades(self) + --debug_trades(self) if self.child or self.order == WORK then mcl_log("A child or already working so don't send to work") return @@ -1057,7 +1057,11 @@ local function do_activity (self) end -- Only check in day or during thunderstorm but wandered_too_far code won't work - local wandered_too_far = ( self.state ~= PATHFINDING ) and (vector.distance(self.object:get_pos(),self._bed) > 50 ) + local wandered_too_far = false + if check_bed (self) then + wandered_too_far = ( self.state ~= PATHFINDING ) and (vector.distance(self.object:get_pos(),self._bed) > 50 ) + end + if wandered_too_far then --mcl_log("Wandered too far! Return home ")