Fix turtles crash when right click on it.

This commit is contained in:
sys4-fr 2018-09-29 11:32:33 +02:00
parent 04474de70c
commit a1c3603056
1 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,22 @@
if mobs.mod and mobs.mod == "redo" then
local sin = math.sin
local cos = math.cos
-- move mob in facing direction
local set_velocity = function(self, v)
local yaw = (self.object:get_yaw() or 0) + self.rotate
self.object:setvelocity(
{
x = sin(yaw) * -v,
y = self.object:getvelocity().y,
z = cos(yaw) * v
})
end
local l_colors = {
"#604000:175", --brown
"#604000:100", --brown2