1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-12 12:38:02 +00:00
OpenMW/apps/opencs/model/world/pathgrid.cpp
2014-10-04 15:36:52 +02:00

36 lines
639 B
C++

#include "pathgrid.hpp"
#include <sstream>
void CSMWorld::Pathgrid::load (ESM::ESMReader &esm, const IdCollection<Cell>& cells)
{
load (esm);
// 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)
{
ESM::Pathgrid::load (esm);
if (mCell.empty())
{
std::ostringstream stream;
stream << "#" << mData.mX << " " << mData.mY;
mId = stream.str();
}
else
mId = mCell;
}