summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR-one <r1-c@live.fr>2017-12-24 20:27:50 +0100
committerR-one <r1-c@live.fr>2017-12-24 20:27:50 +0100
commitf1a9b5b8c1d23417c70babdd43934a1c5c50a9a4 (patch)
tree2e87a11eee1fbc1176e747064c2921fb512e0efd
parentbd513c34bf41c3d75f91b11d6c21d417f6e19c7c (diff)
Fix crash when right click on turtle ... https://github.com/EdwardThorsten/mobs_water/commit/82746827a9dc2cf753a901d101e6d480550bf541HEADorigin/masterorigin/HEADmaster
-rw-r--r--mobs_turtles/init.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/mobs_turtles/init.lua b/mobs_turtles/init.lua
index 7b468ee..220bb94 100644
--- a/mobs_turtles/init.lua
+++ b/mobs_turtles/init.lua
@@ -54,9 +54,15 @@ if mobs.mod and mobs.mod == "redo" then
follow = "farming:carrot",
on_rightclick = function(self, clicker)
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)
- minetest.after(5, function()
+ minetest.after(5, function()
self.state = "stand"
end)
mobs:capture_mob(self, clicker, 0, 80, 100, true, nil)