From fc6a203da2141aac813f5a2d32a60df1f77eaa8c Mon Sep 17 00:00:00 2001 From: ElCeejo Date: Thu, 21 Jul 2022 16:00:26 -0700 Subject: [PATCH] Add limit to bouyancy --- mob_meta.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mob_meta.lua b/mob_meta.lua index e1e418c..bc75f88 100644 --- a/mob_meta.lua +++ b/mob_meta.lua @@ -935,9 +935,11 @@ local function water_physics(self) local submergence = surface_pos.y - floor_pos.y local vel = self.object:get_velocity() local bouyancy = self.bouyancy_multiplier or 1 + local accel = (submergence - vel.y * abs(vel.y) * 0.4) * bouyancy + if accel > 4.9 then accel = 4.9 end self.object:set_acceleration({ x = 0, - y = (submergence - vel.y * abs(vel.y) * 0.4) * bouyancy, + y = accel, z = 0 }) local hydrodynamics = self.hydrodynamics_multiplier or 0.7