1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 07:53:52 +00:00
openmw/apps/opencs/model/world/pathgrid.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
791 B
C++
Raw Normal View History

2014-10-02 10:30:15 +00:00
#include "pathgrid.hpp"
#include "cell.hpp"
#include "idcollection.hpp"
2014-10-02 10:30:15 +00:00
#include <sstream>
void CSMWorld::Pathgrid::load(ESM::ESMReader& esm, bool& isDeleted, const IdCollection<Cell>& cells)
2014-10-04 13:36:52 +00:00
{
load(esm, isDeleted);
2014-10-04 13:36:52 +00:00
// correct ID
if (!mId.empty() && mId.getRefIdString()[0] != '#' && cells.searchId(mId) == -1)
2014-10-04 13:36:52 +00:00
{
std::ostringstream stream;
stream << "#" << mData.mX << " " << mData.mY;
mId = ESM::RefId::stringRefId(stream.str());
2014-10-04 13:36:52 +00:00
}
}
void CSMWorld::Pathgrid::load(ESM::ESMReader& esm, bool& isDeleted)
2014-10-02 10:30:15 +00:00
{
ESM::Pathgrid::load(esm, isDeleted);
2014-10-02 10:30:15 +00:00
mId = mCell;
2014-10-02 10:30:15 +00:00
if (mCell.empty())
{
std::ostringstream stream;
stream << "#" << mData.mX << " " << mData.mY;
mId = ESM::RefId::stringRefId(stream.str());
2014-10-02 10:30:15 +00:00
}
}