mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
fixed cell change crash
This commit is contained in:
parent
c7fb27e801
commit
bed45a936e
@ -35,7 +35,7 @@ int ExteriorCellRender::uniqueID = 0;
|
|||||||
|
|
||||||
ExteriorCellRender::ExteriorCellRender(ESMS::CellStore<MWWorld::RefData> &_cell, MWWorld::Environment& environment,
|
ExteriorCellRender::ExteriorCellRender(ESMS::CellStore<MWWorld::RefData> &_cell, MWWorld::Environment& environment,
|
||||||
MWScene &_scene)
|
MWScene &_scene)
|
||||||
: mCell(_cell), mEnvironment (environment), mScene(_scene), mBase(NULL), mInsert(NULL), mAmbientMode (0)
|
: mCell(_cell), mEnvironment (environment), mScene(_scene), mBase(NULL), mInsert(NULL), mAmbientMode (0)
|
||||||
{
|
{
|
||||||
uniqueID = uniqueID +1;
|
uniqueID = uniqueID +1;
|
||||||
sg = Ogre::Root::getSingleton().getSceneManagerIterator().getNext()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
|
sg = Ogre::Root::getSingleton().getSceneManagerIterator().getNext()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
|
||||||
@ -402,7 +402,11 @@ void ExteriorCellRender::destroy()
|
|||||||
|
|
||||||
mBase = NULL;
|
mBase = NULL;
|
||||||
std::cout << "destroy";
|
std::cout << "destroy";
|
||||||
|
if (sg)
|
||||||
|
{
|
||||||
Ogre::Root::getSingleton().getSceneManagerIterator().getNext()->destroyStaticGeometry(sg);
|
Ogre::Root::getSingleton().getSceneManagerIterator().getNext()->destroyStaticGeometry(sg);
|
||||||
|
sg = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch through lighting modes.
|
// Switch through lighting modes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user