1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 01:45:33 +00:00
openmw-tes3mp/apps/openmw/mwworld/livecellref.cpp
2014-03-22 15:00:49 +01:00

37 lines
No EOL
822 B
C++

#include "livecellref.hpp"
#include <components/esm/objectstate.hpp>
#include "ptr.hpp"
#include "class.hpp"
void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
{
mRef = state.mRef;
mData = RefData (state);
Ptr ptr (this);
if (state.mHasLocals)
mData.setLocals (state.mLocals, mClass->getScript (ptr));
mClass->readAdditionalState (ptr, state);
}
void MWWorld::LiveCellRefBase::saveImp (ESM::ObjectState& state) const
{
state.mRef = mRef;
/// \todo get rid of this cast once const-correct Ptr are available
Ptr ptr (const_cast<LiveCellRefBase *> (this));
mData.write (state, mClass->getScript (ptr));
mClass->writeAdditionalState (ptr, state);
}
bool MWWorld::LiveCellRefBase::checkStateImp (const ESM::ObjectState& state)
{
return true;
}