From 1c5eb6137c404e5216a0c21426f8f7af35962659 Mon Sep 17 00:00:00 2001 From: tacigar Date: Fri, 23 Dec 2016 14:04:28 +0900 Subject: [PATCH] make maidroids face to destination when plant and mow --- maidroid_core/cores/farming.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maidroid_core/cores/farming.lua b/maidroid_core/cores/farming.lua index 5f71a76..b2a70f1 100644 --- a/maidroid_core/cores/farming.lua +++ b/maidroid_core/cores/farming.lua @@ -158,6 +158,7 @@ to_plant = function(self) self.time_counters[1] = 0 self.object:setvelocity{x = 0, y = 0, z = 0} self:set_animation(maidroid.animation_frames.MINE) + self:set_yaw_by_direction(vector.subtract(self.destination, self.object:getpos())) return else to_walk_randomly(self) @@ -170,6 +171,7 @@ to_mow = function(self) self.time_counters[1] = 0 self.object:setvelocity{x = 0, y = 0, z = 0} self:set_animation(maidroid.animation_frames.MINE) + self:set_yaw_by_direction(vector.subtract(self.destination, self.object:getpos())) end walk_to_plant_and_mow_common = function(self, dtime) @@ -218,9 +220,7 @@ walk_to_plant_and_mow_common = function(self, dtime) end else - -- self:change_direction(self.path[1]) -- if maidroid is stopped by obstacles, the maidroid must jump. - -- self:change_direction(self.path[1]) local velocity = self.object:getvelocity() if velocity.y == 0 then local front_node = self:get_front_node()