1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 08:15:54 +00:00
openmw/apps/opencs/model/world/pathgrid.cpp
2022-09-22 21:35:26 +03:00

31 lines
724 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[0] != '#' && cells.searchId(mId) == -1)
{
std::ostringstream stream;
stream << "#" << mData.mX << " " << mData.mY;
mId = 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 = stream.str();
}
}