Don't reset delete flag when loading reference from a save game (Fixes #2724)

openmw-38
scrawl 9 years ago
parent 850092a5e5
commit 18cce3a6f9

@ -19,7 +19,7 @@ MWWorld::LiveCellRefBase::LiveCellRefBase(std::string type, const ESM::CellRef &
void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state) void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
{ {
mRef = state.mRef; mRef = state.mRef;
mData = RefData (state); mData = RefData (state, mData.isDeletedByContentFile());
Ptr ptr (this); Ptr ptr (this);

@ -49,8 +49,8 @@ namespace MWWorld
{ {
} }
RefData::RefData (const ESM::ObjectState& objectState) RefData::RefData (const ESM::ObjectState& objectState, bool deleted)
: mBaseNode(0), mDeleted(false), : mBaseNode(0), mDeleted(deleted),
mEnabled (objectState.mEnabled != 0), mEnabled (objectState.mEnabled != 0),
mCount (objectState.mCount), mCount (objectState.mCount),
mPosition (objectState.mPosition), mPosition (objectState.mPosition),

@ -30,10 +30,14 @@ namespace MWWorld
MWScript::Locals mLocals; MWScript::Locals mLocals;
bool mDeleted; // separate delete flag used for deletion by a content file /// separate delete flag used for deletion by a content file
/// @note not stored in the save game file.
bool mDeleted;
bool mEnabled; bool mEnabled;
int mCount; // 0: deleted
/// 0: deleted
int mCount;
ESM::Position mPosition; ESM::Position mPosition;
@ -51,10 +55,10 @@ namespace MWWorld
/// @param cellRef Used to copy constant data such as position into this class where it can /// @param cellRef Used to copy constant data such as position into this class where it can
/// be altered without affecting the original data. This makes it possible /// be altered without affecting the original data. This makes it possible
/// to reset the position as the orignal data is still held in the CellRef /// to reset the position as the original data is still held in the CellRef
RefData (const ESM::CellRef& cellRef); RefData (const ESM::CellRef& cellRef);
RefData (const ESM::ObjectState& objectState); RefData (const ESM::ObjectState& objectState, bool deleted);
///< Ignores local variables and custom data (not enough context available here to ///< Ignores local variables and custom data (not enough context available here to
/// perform these operations). /// perform these operations).

Loading…
Cancel
Save