1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

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 <components/esm/objectstate.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "ptr.hpp" #include "ptr.hpp"
#include "class.hpp" #include "class.hpp"
#include "esmstore.hpp"
void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state) void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
{ {
@ -14,7 +18,13 @@ void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
Ptr ptr (this); Ptr ptr (this);
if (state.mHasLocals) 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); 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) void RefData::setCount (int count)
{ {
if(count == 0) if(count == 0)

View file

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