mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 12:31:05 +01:00
Fix bug
This commit is contained in:
parent
04cac7156e
commit
bf491c35a1
2 changed files with 9 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -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 ")
|
||||
|
|
Loading…
Reference in a new issue