diff --git a/api.lua b/api.lua index 8e4195e..57019fe 100644 --- a/api.lua +++ b/api.lua @@ -19,7 +19,6 @@ local function clamp(val, min, max) end local vec_dist = vector.distance -local vec_multi = vector.multiply local vec_equals = vector.equals local vec_add = vector.add @@ -437,7 +436,7 @@ function creatura.drop_items(self) end end -function creatura.basic_punch_func(self, puncher, time_from_last_punch, tool_capabilities, direction, damage) +function creatura.basic_punch_func(self, puncher, time_from_last_punch, tool_capabilities, direction) if not puncher then return end local tool = "" if puncher:is_player() then diff --git a/methods.lua b/methods.lua index fd745a0..597d8e0 100644 --- a/methods.lua +++ b/methods.lua @@ -305,7 +305,7 @@ creatura.register_movement_method("creatura:obstacle_avoidance", function(self) _self:halt() return true end - --local steer_to = get_avoidance_dir(_self, goal) + local steer_to = get_avoidance_dir(_self, goal) -- Get movement direction local goal_dir = vec_dir(pos, goal) if steer_to then diff --git a/mob_meta.lua b/mob_meta.lua index bc75f88..46c105c 100644 --- a/mob_meta.lua +++ b/mob_meta.lua @@ -166,12 +166,12 @@ local function lerp_rad(a, b, w) end function mob:turn_to(tyaw, rate) + self.last_yaw = self.object:get_yaw() self._tyaw = tyaw rate = rate or 5 local yaw = self.object:get_yaw() local step = math.min(self.dtime * rate, abs(diff(yaw, tyaw)) % (pi2)) self.object:set_yaw(lerp_rad(yaw, tyaw, step)) - self.last_yaw = self.object:get_yaw() end -- Set Gravity (default of -9.8)