|
|
|
@ -15,6 +15,8 @@
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
|
|
|
|
|
|
#include "../mwmechanics/creaturestats.hpp"
|
|
|
|
|
|
|
|
|
|
#include "ptr.hpp"
|
|
|
|
|
#include "esmstore.hpp"
|
|
|
|
|
#include "class.hpp"
|
|
|
|
@ -40,6 +42,22 @@ namespace
|
|
|
|
|
return MWWorld::Ptr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
MWWorld::Ptr searchViaActorId (MWWorld::CellRefList<T>& actorList, int actorId,
|
|
|
|
|
MWWorld::CellStore *cell)
|
|
|
|
|
{
|
|
|
|
|
for (typename MWWorld::CellRefList<T>::List::iterator iter (actorList.mList.begin());
|
|
|
|
|
iter!=actorList.mList.end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr actor (&*iter, cell);
|
|
|
|
|
|
|
|
|
|
if (MWWorld::Class::get (actor).getCreatureStats (actor).matchesActorId (actorId))
|
|
|
|
|
return actor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return MWWorld::Ptr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename RecordType, typename T>
|
|
|
|
|
void writeReferenceCollection (ESM::ESMWriter& writer,
|
|
|
|
|
const MWWorld::CellRefList<T>& collection)
|
|
|
|
@ -319,6 +337,17 @@ namespace MWWorld
|
|
|
|
|
return Ptr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ptr CellStore::searchViaActorId (int id)
|
|
|
|
|
{
|
|
|
|
|
if (Ptr ptr = ::searchViaActorId (mNpcs, id, this))
|
|
|
|
|
return ptr;
|
|
|
|
|
|
|
|
|
|
if (Ptr ptr = ::searchViaActorId (mCreatures, id, this))
|
|
|
|
|
return ptr;
|
|
|
|
|
|
|
|
|
|
return Ptr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float CellStore::getWaterLevel() const
|
|
|
|
|
{
|
|
|
|
|
return mWaterLevel;
|
|
|
|
|