fix for previous commit

This commit is contained in:
Marc Zinnschlag 2014-03-22 16:39:24 +01:00
parent 6bd3b3ee78
commit 87ae03b5d4
3 changed files with 11 additions and 9 deletions

View file

@ -3,8 +3,12 @@
#include <components/esm/objectstate.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "ptr.hpp"
#include "class.hpp"
#include "esmstore.hpp"
void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
{
@ -14,7 +18,13 @@ void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
Ptr ptr (this);
if (state.mHasLocals)
mData.setLocals (state.mLocals, mClass->getScript (ptr));
{
std::string scriptId = mClass->getScript (ptr);
mData.setLocals (*MWBase::Environment::get().getWorld()->getStore().
get<ESM::Script>().search (scriptId));
mData.getLocals().read (state.mLocals, scriptId);
}
mClass->readAdditionalState (ptr, state);
}

View file

@ -152,12 +152,6 @@ namespace MWWorld
}
}
void RefData::setLocals (const ESM::Locals& locals, const std::string& scriptId)
{
mHasLocals = true;
mLocals.read (locals, scriptId);
}
void RefData::setCount (int count)
{
if(count == 0)

View file

@ -83,8 +83,6 @@ namespace MWWorld
void setLocals (const ESM::Script& script);
void setLocals (const ESM::Locals& locals, const std::string& scriptId);
void setCount (int count);
/// Set object count (an object pile is a simple object with a count >1).
///