1
0
Fork 0
This commit is contained in:
ancientmarinerdev 2022-10-28 00:05:03 +01:00 committed by cora
parent 04cac7156e
commit bf491c35a1
2 changed files with 9 additions and 6 deletions

View File

@ -2614,8 +2614,7 @@ local function check_gowp(self,dtime)
elseif self.current_target then elseif self.current_target then
-- No waypoints left, but have current target. Potentially last waypoint to go to. -- 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) .. "self.current_target: ".. minetest.pos_to_string(self.current_target))
mcl_log("pos: ".. minetest.pos_to_string(p))
go_to_pos(self,self.current_target) go_to_pos(self,self.current_target)
-- Do i just delete current_target, and return so we can find final path. -- Do i just delete current_target, and return so we can find final path.
else 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 -- 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 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) go_to_pos(self,self._current_target)
else 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 self.current_target = nil
--go_to_pos(self,self._target) --go_to_pos(self,self._target)
self.waypoints=minetest.find_path(updated_p,self._target,150,1,4) self.waypoints=minetest.find_path(updated_p,self._target,150,1,4)

View File

@ -952,7 +952,7 @@ local function validate_jobsite(self)
end end
local function do_work (self) local function do_work (self)
debug_trades(self) --debug_trades(self)
if self.child or self.order == WORK then if self.child or self.order == WORK then
mcl_log("A child or already working so don't send to work") mcl_log("A child or already working so don't send to work")
return return
@ -1057,7 +1057,11 @@ local function do_activity (self)
end end
-- Only check in day or during thunderstorm but wandered_too_far code won't work -- 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 if wandered_too_far then
--mcl_log("Wandered too far! Return home ") --mcl_log("Wandered too far! Return home ")