mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-02 07:43:48 +01:00
Prevent floating mobs from drowning all the time
Less dieing for mobs in deep water.
parent
6ae597c97f
commit
898a183ccd
@ -943,7 +943,7 @@ function mob_class:falling(pos)
|
||||
|
||||
-- in water then float up
|
||||
if registered_node.groups.water then
|
||||
if acc and self.floats == 1 and minetest.registered_nodes[node_ok(vector.offset(pos,0,self.collisionbox[5],0)).name].groups.water then
|
||||
if acc and minetest.registered_nodes[node_ok(vector.offset(pos,0,self.collisionbox[5] -0.25,0)).name].groups.water then
|
||||
self.object:set_acceleration(vector.new(0, -self.fall_speed / (math.max(1, v.y) ^ 2), 0))
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user