[Client] Fix invalid read (memcheck warning)

sol2-server-rewrite
Koncord 7 years ago
parent 2bc79fcdf4
commit cd03d59056

@ -1333,7 +1333,7 @@ void LocalPlayer::clearCurrentContainer()
currentContainer.mpNum = 0;
}
void LocalPlayer::storeCellState(ESM::Cell cell, int stateType)
void LocalPlayer::storeCellState(const ESM::Cell& cell, int stateType)
{
std::vector<CellState>::iterator iter;

@ -84,8 +84,8 @@ namespace mwmp
void clearCellStates();
void clearCurrentContainer();
void storeCellState(ESM::Cell cell, int stateType);
void storeCurrentContainer(const MWWorld::Ptr& container);
void storeCellState(const ESM::Cell& cell, int stateType);
private:
Networking *getNetworking();

@ -261,16 +261,6 @@ namespace MWWorld
mPhysics->removeHeightField ((*iter)->getCell()->getGridX(), (*iter)->getCell()->getGridY());
}
MWBase::Environment::get().getMechanicsManager()->drop (*iter);
mRendering.removeCell(*iter);
MWBase::Environment::get().getWindowManager()->removeCell(*iter);
MWBase::Environment::get().getWorld()->getLocalScripts().clearCell (*iter);
MWBase::Environment::get().getSoundManager()->stopSound (*iter);
mActiveCells.erase(*iter);
/*
Start of tes3mp addition
@ -280,6 +270,16 @@ namespace MWWorld
/*
End of tes3mp addition
*/
MWBase::Environment::get().getMechanicsManager()->drop (*iter);
mRendering.removeCell(*iter);
MWBase::Environment::get().getWindowManager()->removeCell(*iter);
MWBase::Environment::get().getWorld()->getLocalScripts().clearCell (*iter);
MWBase::Environment::get().getSoundManager()->stopSound (*iter);
mActiveCells.erase(*iter);
}
void Scene::loadCell (CellStore *cell, Loading::Listener* loadingListener, bool respawn)

Loading…
Cancel
Save