1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 07:09:42 +00:00

Reduce calls in CharacterController::updateIdleStormState

This commit is contained in:
ζeh Matt 2022-04-09 01:21:34 +03:00
parent e85a979f10
commit dd222b9ef1
No known key found for this signature in database
GPG key ID: 18CE582C71A225B0

View file

@ -1101,9 +1101,10 @@ void CharacterController::updateIdleStormState(bool inwater)
return;
}
if (MWBase::Environment::get().getWorld()->isInStorm())
auto* world = MWBase::Environment::get().getWorld();
if (world->isInStorm())
{
osg::Vec3f stormDirection = MWBase::Environment::get().getWorld()->getStormDirection();
osg::Vec3f stormDirection = world->getStormDirection();
osg::Vec3f characterDirection = mPtr.getRefData().getBaseNode()->getAttitude() * osg::Vec3f(0,1,0);
stormDirection.normalize();
characterDirection.normalize();