fix cod behavior

This commit is contained in:
epCode 2021-03-30 19:00:58 -07:00
parent 36a24c6c07
commit 7d864fb7b8
1 changed files with 5 additions and 3 deletions

View File

@ -79,7 +79,9 @@ local cod = {
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))
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
for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do
local lp = object:get_pos()