avoid divide by zero when counteracting bouyancy bounce for players

reported by sir_skurpsalot: https://discord.com/channels/358091480004558848/783127087820439582/1518054290524995644
This commit is contained in:
AzaezelX 2026-06-20 20:37:05 -05:00
parent 280866724d
commit f912bc172d

View file

@ -2864,7 +2864,10 @@ void Player::updateMove(const Move* move)
speed_bias = speed_bias + (speed_bias_goal - speed_bias)*0.1f;
moveSpeed *= speed_bias;
// Acceleration due to gravity
VectorF acc(0.0f, 0.0f, mNetGravity/(1.0 - mBuoyancy) * TickSec);
F32 invBuoyancy = (1.0 - mBuoyancy);
if (mFabs(invBuoyancy) < POINT_EPSILON)
invBuoyancy = POINT_EPSILON;
VectorF acc(0.0f, 0.0f, mNetGravity / invBuoyancy * TickSec);
if (getParent() !=NULL)
acc = VectorF::Zero;