1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 16:23:52 +00:00

Fix crash when northmarker has been disabled (Bug #2230)

This commit is contained in:
scrawl 2014-12-27 14:43:07 +01:00
parent 2f0793390f
commit 50e31877ab

View file

@ -1699,8 +1699,9 @@ namespace MWWorld
MWWorld::LiveCellRef<ESM::Static>* ref = statics.find("northmarker");
if (!ref)
return Vector2(0, 1);
Ogre::SceneNode* node = ref->mData.getBaseNode();
Vector3 dir = node->_getDerivedOrientation() * Ogre::Vector3(0,1,0);
Ogre::Quaternion orient (Ogre::Radian(-ref->mData.getPosition().rot[2]), Ogre::Vector3::UNIT_Z);
Vector3 dir = orient * Ogre::Vector3(0,1,0);
Vector2 d = Vector2(dir.x, dir.y);
return d;
}