mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 03:39:55 +00:00
fixed crash bug
This commit is contained in:
parent
012a41427c
commit
6d8cfa7dfa
@ -31,7 +31,7 @@ namespace MWWorld
|
||||
}
|
||||
|
||||
mWorld->removeScripts (iter->first);
|
||||
|
||||
|
||||
mEnvironment.mMechanicsManager->dropActors (iter->first); // FIXME: gehört in world?
|
||||
mEnvironment.mSoundManager->stopSound (iter->first); // FIXME: same
|
||||
delete iter->second;
|
||||
@ -152,21 +152,21 @@ namespace MWWorld
|
||||
|
||||
Scene::~Scene()
|
||||
{
|
||||
/*for (CellRenderCollection::iterator iter (mActiveCells.begin());
|
||||
for (CellRenderCollection::iterator iter (mActiveCells.begin());
|
||||
iter!=mActiveCells.end(); ++iter)
|
||||
delete iter->second;*/
|
||||
delete iter->second;
|
||||
}
|
||||
|
||||
bool Scene::hasCellChanged() const
|
||||
{
|
||||
return mCellChanged;
|
||||
}
|
||||
|
||||
|
||||
std::map<Ptr::CellStore *, MWRender::CellRender *> Scene::getActiveCells ()
|
||||
{
|
||||
return mActiveCells;
|
||||
}
|
||||
|
||||
|
||||
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
|
||||
{
|
||||
SuppressDoingPhysics scopeGuard;
|
||||
@ -206,7 +206,7 @@ namespace MWWorld
|
||||
|
||||
changeCell (x, y, position, true);
|
||||
}
|
||||
|
||||
|
||||
Ptr::CellStore* Scene::getCurrentCell ()
|
||||
{
|
||||
return mCurrentCell;
|
||||
@ -217,4 +217,3 @@ namespace MWWorld
|
||||
mCellChanged = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ namespace MWWorld
|
||||
|
||||
typedef std::map<Ptr::CellStore *, MWRender::CellRender *> CellRenderCollection;
|
||||
|
||||
MWRender::MWScene mScene;
|
||||
MWRender::MWScene& mScene;
|
||||
Ptr::CellStore *mCurrentCell; // the cell, the player is in
|
||||
CellRenderCollection mActiveCells;
|
||||
bool mCellChanged;
|
||||
@ -81,9 +81,9 @@ namespace MWWorld
|
||||
void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos);
|
||||
///< Move from exterior to interior or from interior cell to a different
|
||||
/// interior cell.
|
||||
|
||||
|
||||
Ptr::CellStore* getCurrentCell ();
|
||||
|
||||
|
||||
CellRenderCollection getActiveCells ();
|
||||
|
||||
bool hasCellChanged() const;
|
||||
@ -92,10 +92,10 @@ namespace MWWorld
|
||||
void changeToInteriorCell (const std::string& cellName, const ESM::Position& position);
|
||||
///< Move to interior cell.
|
||||
|
||||
void changeToExteriorCell (const ESM::Position& position);
|
||||
void changeToExteriorCell (const ESM::Position& position);
|
||||
///< Move to exterior cell.
|
||||
|
||||
void markCellAsUnchanged();
|
||||
void markCellAsUnchanged();
|
||||
|
||||
std::string getFacedHandle();
|
||||
};
|
||||
|
@ -283,7 +283,7 @@ namespace MWWorld
|
||||
mSky (false), mEnvironment (environment), mNextDynamicRecord (0)
|
||||
{
|
||||
mPhysEngine = physEng;
|
||||
|
||||
|
||||
mPhysics = new PhysicsSystem(renderer, physEng);
|
||||
|
||||
boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master));
|
||||
@ -311,16 +311,16 @@ namespace MWWorld
|
||||
MWRender::SkyManager::create(renderer.getWindow(), mScene.getCamera(), resDir);
|
||||
|
||||
mPhysEngine = physEng;
|
||||
|
||||
|
||||
mWorldScene = new Scene(environment, this, mScene, mPhysics);
|
||||
}
|
||||
|
||||
World::~World()
|
||||
{
|
||||
delete mPlayer;
|
||||
delete mWorldScene;
|
||||
delete mSkyManager;
|
||||
delete mGlobalVariables;
|
||||
//delete mWorldScene;
|
||||
delete mPlayer;
|
||||
delete mPhysics;
|
||||
}
|
||||
|
||||
@ -347,12 +347,12 @@ namespace MWWorld
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Ptr::CellStore *World::getExterior (int x, int y)
|
||||
{
|
||||
return &mExteriors[std::make_pair (x, y)];
|
||||
}
|
||||
|
||||
|
||||
Ptr::CellStore *World::getInterior (std::string name)
|
||||
{
|
||||
return &mInteriors[name];
|
||||
@ -367,7 +367,7 @@ namespace MWWorld
|
||||
{
|
||||
return mStore;
|
||||
}
|
||||
|
||||
|
||||
ESM::ESMReader& World::getEsmReader()
|
||||
{
|
||||
return mEsm;
|
||||
@ -768,4 +768,3 @@ namespace MWWorld
|
||||
return std::make_pair (stream.str(), created);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user