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:
parent
2f0793390f
commit
50e31877ab
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue