forked from teamnwah/openmw-tes3coop
load and save pathgrid records
parent
ff530a2e19
commit
d64127106b
@ -0,0 +1,20 @@
|
||||
|
||||
#include "pathgrid.hpp"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
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;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
#ifndef CSM_WOLRD_PATHGRID_H
|
||||
#define CSM_WOLRD_PATHGRID_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <components/esm/loadpgrd.hpp>
|
||||
|
||||
namespace CSMWorld
|
||||
{
|
||||
/// \brief Wrapper for Pathgrid record
|
||||
///
|
||||
/// \attention The mData.mX and mData.mY fields of the ESM::Pathgrid struct are not used.
|
||||
/// Exterior cell coordinates are encoded in the pathgrid ID.
|
||||
struct Pathgrid : public ESM::Pathgrid
|
||||
{
|
||||
std::string mId;
|
||||
|
||||
void load (ESM::ESMReader &esm);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue