1
0
mirror of https://github.com/blert2112/mobs_water.git synced 2024-12-29 19:00:17 +01:00

Fix crash when right click on turtle ... 82746827a9

This commit is contained in:
R-one 2017-12-24 20:27:50 +01:00
parent bd513c34bf
commit f1a9b5b8c1

View File

@ -54,7 +54,13 @@ if mobs.mod and mobs.mod == "redo" then
follow = "farming:carrot", follow = "farming:carrot",
on_rightclick = function(self, clicker) on_rightclick = function(self, clicker)
self.state = "" self.state = ""
set_velocity(self, 0) --set_velocity(self, 0)
self.object:setvelocity({
--local yaw = (self.object:get_yaw() or 0) + self.rotate
x = 0, --sin(yaw) * -v
y = self.object:getvelocity().y,
z = 0 --cos(yaw) * v
})
self.object:set_animation({x=self.animation.hide_start, y=self.animation.hide_end}, self.animation.speed_normal, 0) self.object:set_animation({x=self.animation.hide_start, y=self.animation.hide_end}, self.animation.speed_normal, 0)
minetest.after(5, function() minetest.after(5, function()
self.state = "stand" self.state = "stand"