mirror of https://github.com/OpenMW/openmw.git
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
781 B
C++
32 lines
781 B
C++
#include "pathgrid.hpp"
|
|
#include "cell.hpp"
|
|
#include "idcollection.hpp"
|
|
|
|
#include <sstream>
|
|
|
|
void CSMWorld::Pathgrid::load(ESM::ESMReader& esm, bool& isDeleted, const IdCollection<Cell>& cells)
|
|
{
|
|
load(esm, isDeleted);
|
|
|
|
// correct ID
|
|
if (!mId.empty() && !mId.startsWith("#") && cells.searchId(mId) == -1)
|
|
{
|
|
std::ostringstream stream;
|
|
stream << "#" << mData.mX << " " << mData.mY;
|
|
mId = ESM::RefId::stringRefId(stream.str());
|
|
}
|
|
}
|
|
|
|
void CSMWorld::Pathgrid::load(ESM::ESMReader& esm, bool& isDeleted)
|
|
{
|
|
ESM::Pathgrid::load(esm, isDeleted);
|
|
|
|
mId = mCell;
|
|
if (mCell.empty())
|
|
{
|
|
std::ostringstream stream;
|
|
stream << "#" << mData.mX << " " << mData.mY;
|
|
mId = ESM::RefId::stringRefId(stream.str());
|
|
}
|
|
}
|