Fix mobs flopping for the first second when in thier own element

This commit is contained in:
epCode 2022-10-31 23:10:51 +00:00 committed by cora
parent 1d3f52004f
commit 9099f3ac7a
1 changed files with 2 additions and 2 deletions

View File

@ -531,7 +531,7 @@ local flight_check = function(self)
end end
for _,checknode in pairs(fly_in) do for _,checknode in pairs(fly_in) do
if nod == checknode then if nod == checknode or nod == "ignore" then
return true return true
end end
end end
@ -2468,7 +2468,7 @@ local follow_flop = function(self)
-- swimmers flop when out of their element, and swim again when back in -- swimmers flop when out of their element, and swim again when back in
if self.fly then if self.fly then
local s = self.object:get_pos() local s = self.object:get_pos()
if not flight_check(self, s) then if flight_check(self, s) == false then
self.state = "flop" self.state = "flop"
self.object:set_acceleration({x = 0, y = DEFAULT_FALL_SPEED, z = 0}) self.object:set_acceleration({x = 0, y = DEFAULT_FALL_SPEED, z = 0})