1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 22:15:35 +00:00

Avoid division by zero in movementsolver when an actor is immobile and

in a storm
This commit is contained in:
fredzio 2021-08-08 17:19:18 +02:00
parent 8ad3d3d792
commit b4dd9e6b4d

View file

@ -163,7 +163,7 @@ namespace MWPhysics
}
// Now that we have the effective movement vector, apply wind forces to it
if (worldData.mIsInStorm)
if (worldData.mIsInStorm && velocity.length() > 0)
{
osg::Vec3f stormDirection = worldData.mStormDirection;
float angleDegrees = osg::RadiansToDegrees(std::acos(stormDirection * velocity / (stormDirection.length() * velocity.length())));