forked from mirror/openmw-tes3mp
Don't leave stale player CharacterController in Actors when loading game (Fixes #1713)
This commit is contained in:
parent
d81e9cfefd
commit
6262d6c964
2 changed files with 10 additions and 8 deletions
|
@ -924,12 +924,7 @@ namespace MWMechanics
|
|||
|
||||
Actors::~Actors()
|
||||
{
|
||||
PtrControllerMap::iterator it(mActors.begin());
|
||||
for (; it != mActors.end(); ++it)
|
||||
{
|
||||
delete it->second;
|
||||
it->second = NULL;
|
||||
}
|
||||
clear();
|
||||
}
|
||||
|
||||
void Actors::addActor (const MWWorld::Ptr& ptr, bool updateImmediately)
|
||||
|
@ -1359,6 +1354,13 @@ namespace MWMechanics
|
|||
|
||||
void Actors::clear()
|
||||
{
|
||||
PtrControllerMap::iterator it(mActors.begin());
|
||||
for (; it != mActors.end(); ++it)
|
||||
{
|
||||
delete it->second;
|
||||
it->second = NULL;
|
||||
}
|
||||
mActors.clear();
|
||||
mDeathCount.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2111,8 +2111,8 @@ namespace MWWorld
|
|||
void World::enableActorCollision(const MWWorld::Ptr& actor, bool enable)
|
||||
{
|
||||
OEngine::Physic::PhysicActor *physicActor = mPhysEngine->getCharacter(actor.getRefData().getHandle());
|
||||
|
||||
physicActor->enableCollisionBody(enable);
|
||||
if (physicActor)
|
||||
physicActor->enableCollisionBody(enable);
|
||||
}
|
||||
|
||||
bool World::findInteriorPosition(const std::string &name, ESM::Position &pos)
|
||||
|
|
Loading…
Reference in a new issue