1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 18:40:01 +00:00

Merge branch 'div0' into 'master'

Fix UBSAN warning

See merge request OpenMW/openmw!1107
This commit is contained in:
psi29a 2021-08-08 17:19:13 +00:00
commit 99e30115a9

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())));