forked from epCode/extra_mobs
fix cod behavior
This commit is contained in:
parent
36a24c6c07
commit
7d864fb7b8
4
cod.lua
4
cod.lua
|
@ -79,7 +79,9 @@ local cod = {
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
|
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
|
||||||
if minetest.get_item_group(self.standing_in, "water") ~= 0 then
|
if minetest.get_item_group(self.standing_in, "water") ~= 0 then
|
||||||
self.object:add_velocity({ x = 0 , y = math.random(-.05, .05) , z = 0 })
|
if self.object:get_velocity().y < 2.5 then
|
||||||
|
self.object:add_velocity({ x = 0 , y = math.random(-.002, .002) , z = 0 })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do
|
for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do
|
||||||
local lp = object:get_pos()
|
local lp = object:get_pos()
|
||||||
|
|
Loading…
Reference in New Issue