forked from teamnwah/openmw-tes3coop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
723 B
C++
32 lines
723 B
C++
#ifndef GAME_MWCLASS_CONTAINERUTIL_H
|
|
#define GAME_MWCLASS_CONTAINERUTIL_H
|
|
|
|
#include <components/esm_store/cell_store.hpp>
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
#include "../mwworld/containerstore.hpp"
|
|
|
|
namespace MWClass
|
|
{
|
|
template<typename T>
|
|
void insertIntoContainerStore (const MWWorld::Ptr& ptr,
|
|
ESMS::CellRefList<T, MWWorld::RefData>& containerStore)
|
|
{
|
|
if (!ptr.isEmpty())
|
|
{
|
|
// TODO check stacking
|
|
|
|
ESMS::LiveCellRef<T, MWWorld::RefData> cellRef;
|
|
|
|
cellRef.base = ptr.get<T>()->base;
|
|
cellRef.ref = ptr.getCellRef();
|
|
cellRef.mData = ptr.getRefData();
|
|
|
|
containerStore.list.push_back (cellRef);
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|