mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-26 07:06:48 +00:00
CellName is now a RefId, makes more sense that way.
This commit is contained in:
parent
6ff90b34a8
commit
2c30575b3b
58 changed files with 196 additions and 156 deletions
|
@ -1342,7 +1342,7 @@ namespace EsmTool
|
||||||
template <>
|
template <>
|
||||||
std::string Record<ESM::Cell>::getId() const
|
std::string Record<ESM::Cell>::getId() const
|
||||||
{
|
{
|
||||||
return mData.mName;
|
return mData.mName.getRefIdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
|
|
@ -202,7 +202,7 @@ namespace ESSImport
|
||||||
}
|
}
|
||||||
|
|
||||||
// note if the player is in a nameless exterior cell, we will assign the cellId later based on player position
|
// note if the player is in a nameless exterior cell, we will assign the cellId later based on player position
|
||||||
if (cell.mName == mContext->mPlayerCellName)
|
if (cell.mName == ESM::RefId::stringRefId(mContext->mPlayerCellName))
|
||||||
{
|
{
|
||||||
mContext->mPlayer.mCellId = cell.getCellId();
|
mContext->mPlayer.mCellId = cell.getCellId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -351,7 +351,7 @@ namespace ESSImport
|
||||||
std::vector<unsigned int> mFogOfWar;
|
std::vector<unsigned int> mFogOfWar;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::map<std::string, Cell> mIntCells;
|
std::map<ESM::RefId, Cell> mIntCells;
|
||||||
std::map<std::pair<int, int>, Cell> mExtCells;
|
std::map<std::pair<int, int>, Cell> mExtCells;
|
||||||
|
|
||||||
std::vector<ESM::CustomMarker> mMarkers;
|
std::vector<ESM::CustomMarker> mMarkers;
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace ESSImport
|
||||||
// TODO: Figure out a better way to detect interiors. (0, 0) is a valid exterior cell.
|
// TODO: Figure out a better way to detect interiors. (0, 0) is a valid exterior cell.
|
||||||
if (mark.mCellX == 0 && mark.mCellY == 0)
|
if (mark.mCellX == 0 && mark.mCellY == 0)
|
||||||
{
|
{
|
||||||
cell.mWorldspace = pcdt.mMNAM;
|
cell.mWorldspace = ESM::RefId::stringRefId(pcdt.mMNAM);
|
||||||
cell.mPaged = false;
|
cell.mPaged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,5 +48,5 @@ QString CellNameLoader::getCellName(ESM::ESMReader& esmReader)
|
||||||
bool isDeleted = false;
|
bool isDeleted = false;
|
||||||
cell.loadNameAndData(esmReader, isDeleted);
|
cell.loadNameAndData(esmReader, isDeleted);
|
||||||
|
|
||||||
return QString::fromStdString(cell.mName);
|
return QString::fromStdString(cell.mName.getRefIdString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,16 +263,16 @@ namespace NavMeshTool
|
||||||
|
|
||||||
const osg::Vec2i cellPosition(cell.mData.mX, cell.mData.mY);
|
const osg::Vec2i cellPosition(cell.mData.mX, cell.mData.mY);
|
||||||
const std::size_t cellObjectsBegin = data.mObjects.size();
|
const std::size_t cellObjectsBegin = data.mObjects.size();
|
||||||
|
const auto cellNameLowerCase = Misc::StringUtils::lowerCase(cell.mCellId.mWorldspace.getRefIdString());
|
||||||
WorldspaceNavMeshInput& navMeshInput = [&]() -> WorldspaceNavMeshInput& {
|
WorldspaceNavMeshInput& navMeshInput = [&]() -> WorldspaceNavMeshInput& {
|
||||||
auto it = navMeshInputs.find(cell.mCellId.mWorldspace);
|
auto it = navMeshInputs.find(cellNameLowerCase);
|
||||||
if (it == navMeshInputs.end())
|
if (it == navMeshInputs.end())
|
||||||
{
|
{
|
||||||
it = navMeshInputs
|
it = navMeshInputs
|
||||||
.emplace(cell.mCellId.mWorldspace,
|
.emplace(cellNameLowerCase,
|
||||||
std::make_unique<WorldspaceNavMeshInput>(cell.mCellId.mWorldspace, settings.mRecast))
|
std::make_unique<WorldspaceNavMeshInput>(cellNameLowerCase, settings.mRecast))
|
||||||
.first;
|
.first;
|
||||||
it->second->mTileCachedRecastMeshManager.setWorldspace(cell.mCellId.mWorldspace, nullptr);
|
it->second->mTileCachedRecastMeshManager.setWorldspace(cellNameLowerCase, nullptr);
|
||||||
}
|
}
|
||||||
return *it->second;
|
return *it->second;
|
||||||
}();
|
}();
|
||||||
|
|
|
@ -89,7 +89,7 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages& message
|
||||||
|
|
||||||
if (!cellRef.mDestCell.empty() && mCells.searchId(cellRef.mDestCell) == -1)
|
if (!cellRef.mDestCell.empty() && mCells.searchId(cellRef.mDestCell) == -1)
|
||||||
messages.add(
|
messages.add(
|
||||||
id, "Destination cell '" + cellRef.mDestCell + "' does not exist", "", CSMDoc::Message::Severity_Error);
|
id, "Destination cell '" + cellRef.mDestCell.getRefIdString() + "' does not exist", "", CSMDoc::Message::Severity_Error);
|
||||||
|
|
||||||
if (cellRef.mScale < 0)
|
if (cellRef.mScale < 0)
|
||||||
messages.add(id, "Negative scale", "", CSMDoc::Message::Severity_Error);
|
messages.add(id, "Negative scale", "", CSMDoc::Message::Severity_Error);
|
||||||
|
|
|
@ -75,7 +75,7 @@ int CSMTools::TopicInfoCheckStage::setup()
|
||||||
if (regionRecord.isDeleted())
|
if (regionRecord.isDeleted())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mCellNames.insert(regionRecord.get().mName);
|
mCellNames.insert(ESM::RefId::stringRefId(regionRecord.get().mName));
|
||||||
}
|
}
|
||||||
// Default cell name
|
// Default cell name
|
||||||
int index = mGameSettings.searchId("sDefaultCellname");
|
int index = mGameSettings.searchId("sDefaultCellname");
|
||||||
|
@ -85,7 +85,7 @@ int CSMTools::TopicInfoCheckStage::setup()
|
||||||
|
|
||||||
if (!gmstRecord.isDeleted() && gmstRecord.get().mValue.getType() == ESM::VT_String)
|
if (!gmstRecord.isDeleted() && gmstRecord.get().mValue.getType() == ESM::VT_String)
|
||||||
{
|
{
|
||||||
mCellNames.insert(gmstRecord.get().mValue.getString());
|
mCellNames.insert(ESM::RefId::stringRefId(gmstRecord.get().mValue.getString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,10 +213,9 @@ bool CSMTools::TopicInfoCheckStage::verifyActor(
|
||||||
bool CSMTools::TopicInfoCheckStage::verifyCell(
|
bool CSMTools::TopicInfoCheckStage::verifyCell(
|
||||||
const ESM::RefId& cell, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages)
|
const ESM::RefId& cell, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const std::string& cellName = cell.getRefIdString();
|
if (mCellNames.find(cell) == mCellNames.end())
|
||||||
if (mCellNames.find(cellName) == mCellNames.end())
|
|
||||||
{
|
{
|
||||||
messages.add(id, "Cell '" + cellName + "' does not exist", "", CSMDoc::Message::Severity_Error);
|
messages.add(id, "Cell '" + cell.getRefIdString() + "' does not exist", "", CSMDoc::Message::Severity_Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace CSMTools
|
||||||
const CSMWorld::RefIdData& mReferencables;
|
const CSMWorld::RefIdData& mReferencables;
|
||||||
const CSMWorld::Resources& mSoundFiles;
|
const CSMWorld::Resources& mSoundFiles;
|
||||||
|
|
||||||
std::set<std::string> mCellNames;
|
std::set<ESM::RefId> mCellNames;
|
||||||
|
|
||||||
bool mIgnoreBaseRecords;
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ void CSMWorld::Cell::load(ESM::ESMReader& esm, bool& isDeleted)
|
||||||
{
|
{
|
||||||
ESM::Cell::load(esm, isDeleted, false);
|
ESM::Cell::load(esm, isDeleted, false);
|
||||||
|
|
||||||
mId = ESM::RefId::stringRefId(mName);
|
mId = mName;
|
||||||
if (isExterior())
|
if (isExterior())
|
||||||
{
|
{
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <components/esm3/loadrace.hpp>
|
#include <components/esm3/loadrace.hpp>
|
||||||
#include <components/esm3/loadskil.hpp>
|
#include <components/esm3/loadskil.hpp>
|
||||||
#include <components/esm3/variant.hpp>
|
#include <components/esm3/variant.hpp>
|
||||||
|
#include <apps/opencs/model/world/cell.hpp>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
@ -333,6 +334,31 @@ namespace CSMWorld
|
||||||
bool isEditable() const override { return true; }
|
bool isEditable() const override { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct NameColumn<CSMWorld::Cell> : public Column < CSMWorld::Cell>
|
||||||
|
{
|
||||||
|
NameColumn(ColumnBase::Display display = ColumnBase::Display_String)
|
||||||
|
: Column<CSMWorld::Cell>(Columns::ColumnId_Name, display)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant get(const Record<CSMWorld::Cell>& record) const override
|
||||||
|
{
|
||||||
|
return QString::fromUtf8(record.get().mName.getRefIdString().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
void set(Record<CSMWorld::Cell>& record, const QVariant& data) override
|
||||||
|
{
|
||||||
|
CSMWorld::Cell record2 = record.get();
|
||||||
|
|
||||||
|
record2.mName = ESM::RefId::stringRefId(data.toString().toUtf8().constData());
|
||||||
|
|
||||||
|
record.setModified(record2);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isEditable() const override { return true; }
|
||||||
|
};
|
||||||
|
|
||||||
template <typename ESXRecordT>
|
template <typename ESXRecordT>
|
||||||
struct AttributesColumn : public Column<ESXRecordT>
|
struct AttributesColumn : public Column<ESXRecordT>
|
||||||
{
|
{
|
||||||
|
@ -1121,14 +1147,14 @@ namespace CSMWorld
|
||||||
|
|
||||||
QVariant get(const Record<ESXRecordT>& record) const override
|
QVariant get(const Record<ESXRecordT>& record) const override
|
||||||
{
|
{
|
||||||
return QString::fromUtf8(record.get().mDestCell.c_str());
|
return QString::fromUtf8(record.get().mDestCell.getRefIdString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(Record<ESXRecordT>& record, const QVariant& data) override
|
void set(Record<ESXRecordT>& record, const QVariant& data) override
|
||||||
{
|
{
|
||||||
ESXRecordT record2 = record.get();
|
ESXRecordT record2 = record.get();
|
||||||
|
|
||||||
record2.mDestCell = data.toString().toUtf8().constData();
|
record2.mDestCell = ESM::RefId::stringRefId(data.toString().toUtf8().constData());
|
||||||
|
|
||||||
record.setModified(record2);
|
record.setModified(record2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -333,7 +333,7 @@ std::pair<CSMWorld::UniversalId, std::string> CSMWorld::IdTable::view(int row) c
|
||||||
return std::make_pair(UniversalId::Type_None, "");
|
return std::make_pair(UniversalId::Type_None, "");
|
||||||
|
|
||||||
if (id[0] == '#')
|
if (id[0] == '#')
|
||||||
id = ESM::CellId::sDefaultWorldspace;
|
id = ESM::CellId::sDefaultWorldspace.getRefIdString();
|
||||||
|
|
||||||
return std::make_pair(UniversalId(UniversalId::Type_Scene, id), hint);
|
return std::make_pair(UniversalId(UniversalId::Type_Scene, id), hint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace CSMWorld
|
||||||
{
|
{
|
||||||
bool mDeleted;
|
bool mDeleted;
|
||||||
ESM::RefId mRegion;
|
ESM::RefId mRegion;
|
||||||
std::string mName;
|
ESM::RefId mName;
|
||||||
|
|
||||||
CellDescription();
|
CellDescription();
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ CSVWorld::SceneSubView::SceneSubView(const CSMWorld::UniversalId& id, CSMDoc::Do
|
||||||
CSVRender::WorldspaceWidget* worldspaceWidget = nullptr;
|
CSVRender::WorldspaceWidget* worldspaceWidget = nullptr;
|
||||||
widgetType whatWidget;
|
widgetType whatWidget;
|
||||||
|
|
||||||
if (id.getId() == ESM::CellId::sDefaultWorldspace)
|
if (ESM::RefId::stringRefId(id.getId()) == ESM::CellId::sDefaultWorldspace)
|
||||||
{
|
{
|
||||||
whatWidget = widget_Paged;
|
whatWidget = widget_Paged;
|
||||||
|
|
||||||
|
|
|
@ -444,7 +444,7 @@ void OMW::Engine::setResourceDir(const std::filesystem::path& parResDir)
|
||||||
// Set start cell name
|
// Set start cell name
|
||||||
void OMW::Engine::setCell(const std::string& cellName)
|
void OMW::Engine::setCell(const std::string& cellName)
|
||||||
{
|
{
|
||||||
mCellName = cellName;
|
mCellName = ESM::RefId::stringRefId(cellName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OMW::Engine::addContentFile(const std::string& file)
|
void OMW::Engine::addContentFile(const std::string& file)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <components/files/collections.hpp>
|
#include <components/files/collections.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
#include <components/translation/translation.hpp>
|
#include <components/translation/translation.hpp>
|
||||||
|
#include <components/esm/refid.hpp>
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
#include <osgViewer/ViewerEventHandlers>
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
@ -151,7 +152,7 @@ namespace OMW
|
||||||
osg::ref_ptr<SceneUtil::AsyncScreenCaptureOperation> mScreenCaptureOperation;
|
osg::ref_ptr<SceneUtil::AsyncScreenCaptureOperation> mScreenCaptureOperation;
|
||||||
osg::ref_ptr<SceneUtil::SelectDepthFormatOperation> mSelectDepthFormatOperation;
|
osg::ref_ptr<SceneUtil::SelectDepthFormatOperation> mSelectDepthFormatOperation;
|
||||||
osg::ref_ptr<SceneUtil::Color::SelectColorFormatOperation> mSelectColorFormatOperation;
|
osg::ref_ptr<SceneUtil::Color::SelectColorFormatOperation> mSelectColorFormatOperation;
|
||||||
std::string mCellName;
|
ESM::RefId mCellName;
|
||||||
std::vector<std::string> mContentFiles;
|
std::vector<std::string> mContentFiles;
|
||||||
std::vector<std::string> mGroundcoverFiles;
|
std::vector<std::string> mGroundcoverFiles;
|
||||||
|
|
||||||
|
|
|
@ -177,12 +177,12 @@ namespace MWBase
|
||||||
virtual char getGlobalVariableType(std::string_view name) const = 0;
|
virtual char getGlobalVariableType(std::string_view name) const = 0;
|
||||||
///< Return ' ', if there is no global variable with this name.
|
///< Return ' ', if there is no global variable with this name.
|
||||||
|
|
||||||
virtual std::string_view getCellName(const MWWorld::CellStore* cell = nullptr) const = 0;
|
virtual const ESM::RefId& getCellName(const MWWorld::CellStore* cell = nullptr) const = 0;
|
||||||
///< Return name of the cell.
|
///< Return name of the cell.
|
||||||
///
|
///
|
||||||
/// \note If cell==0, the cell the player is currently in will be used instead to
|
/// \note If cell==0, the cell the player is currently in will be used instead to
|
||||||
/// generate a name.
|
/// generate a name.
|
||||||
virtual std::string_view getCellName(const ESM::Cell* cell) const = 0;
|
virtual const ESM::RefId getCellName(const ESM::Cell* cell) const = 0;
|
||||||
|
|
||||||
virtual void removeRefScript(MWWorld::RefData* ref) = 0;
|
virtual void removeRefScript(MWWorld::RefData* ref) = 0;
|
||||||
//< Remove the script attached to ref from mLocalScripts
|
//< Remove the script attached to ref from mLocalScripts
|
||||||
|
@ -248,7 +248,7 @@ namespace MWBase
|
||||||
virtual void setSimulationTimeScale(float scale) = 0;
|
virtual void setSimulationTimeScale(float scale) = 0;
|
||||||
|
|
||||||
virtual void changeToInteriorCell(
|
virtual void changeToInteriorCell(
|
||||||
const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true)
|
const ESM::RefId& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true)
|
||||||
= 0;
|
= 0;
|
||||||
///< Move to interior cell.
|
///< Move to interior cell.
|
||||||
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
||||||
|
@ -263,7 +263,7 @@ namespace MWBase
|
||||||
= 0;
|
= 0;
|
||||||
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
||||||
|
|
||||||
virtual const ESM::Cell* getExterior(std::string_view cellName) const = 0;
|
virtual const ESM::Cell* getExterior(const ESM::RefId& cellName) const = 0;
|
||||||
///< Return a cell matching the given name or a 0-pointer, if there is no such cell.
|
///< Return a cell matching the given name or a 0-pointer, if there is no such cell.
|
||||||
|
|
||||||
virtual MWWorld::Ptr getFacedObject() = 0;
|
virtual MWWorld::Ptr getFacedObject() = 0;
|
||||||
|
@ -519,11 +519,11 @@ namespace MWBase
|
||||||
|
|
||||||
/// Find default position inside exterior cell specified by name
|
/// Find default position inside exterior cell specified by name
|
||||||
/// \return false if exterior with given name not exists, true otherwise
|
/// \return false if exterior with given name not exists, true otherwise
|
||||||
virtual bool findExteriorPosition(std::string_view name, ESM::Position& pos) = 0;
|
virtual bool findExteriorPosition(const ESM::RefId& name, ESM::Position& pos) = 0;
|
||||||
|
|
||||||
/// Find default position inside interior cell specified by name
|
/// Find default position inside interior cell specified by name
|
||||||
/// \return false if interior with given name not exists, true otherwise
|
/// \return false if interior with given name not exists, true otherwise
|
||||||
virtual bool findInteriorPosition(std::string_view name, ESM::Position& pos) = 0;
|
virtual bool findInteriorPosition(const ESM::RefId& name, ESM::Position& pos) = 0;
|
||||||
|
|
||||||
/// Enables or disables use of teleport spell effects (recall, intervention, etc).
|
/// Enables or disables use of teleport spell effects (recall, intervention, etc).
|
||||||
virtual void enableTeleporting(bool enable) = 0;
|
virtual void enableTeleporting(bool enable) = 0;
|
||||||
|
|
|
@ -299,7 +299,7 @@ namespace MWClass
|
||||||
|
|
||||||
std::string Door::getDestination(const MWWorld::LiveCellRef<ESM::Door>& door)
|
std::string Door::getDestination(const MWWorld::LiveCellRef<ESM::Door>& door)
|
||||||
{
|
{
|
||||||
std::string dest = door.mRef.getDestCell();
|
auto dest = door.mRef.getDestCell();
|
||||||
if (dest.empty())
|
if (dest.empty())
|
||||||
{
|
{
|
||||||
// door leads to exterior, use cell name (if any), otherwise translated region name
|
// door leads to exterior, use cell name (if any), otherwise translated region name
|
||||||
|
@ -310,7 +310,7 @@ namespace MWClass
|
||||||
dest = world->getCellName(cell);
|
dest = world->getCellName(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
return "#{sCell=" + dest + "}";
|
return "#{sCell=" + dest.getRefIdString() + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Ptr Door::copyToCellImpl(const MWWorld::ConstPtr& ptr, MWWorld::CellStore& cell) const
|
MWWorld::Ptr Door::copyToCellImpl(const MWWorld::ConstPtr& ptr, MWWorld::CellStore& cell) const
|
||||||
|
|
|
@ -196,7 +196,7 @@ bool MWDialogue::Filter::testPlayer(const ESM::DialInfo& info) const
|
||||||
if (!info.mCell.empty())
|
if (!info.mCell.empty())
|
||||||
{
|
{
|
||||||
// supports partial matches, just like getPcCell
|
// supports partial matches, just like getPcCell
|
||||||
std::string_view playerCell = MWBase::Environment::get().getWorld()->getCellName(player.getCell());
|
std::string_view playerCell = MWBase::Environment::get().getWorld()->getCellName(player.getCell()).getRefIdString();
|
||||||
if (!Misc::StringUtils::ciStartsWith(playerCell, info.mCell.getRefIdString()))
|
if (!Misc::StringUtils::ciStartsWith(playerCell, info.mCell.getRefIdString()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -553,7 +553,7 @@ bool MWDialogue::Filter::getSelectStructBoolean(const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_NotCell:
|
case SelectWrapper::Function_NotCell:
|
||||||
{
|
{
|
||||||
std::string_view actorCell = MWBase::Environment::get().getWorld()->getCellName(mActor.getCell());
|
std::string_view actorCell = MWBase::Environment::get().getWorld()->getCellName(mActor.getCell()).getRefIdString();
|
||||||
return !Misc::StringUtils::ciStartsWith(actorCell, select.getName());
|
return !Misc::StringUtils::ciStartsWith(actorCell, select.getName());
|
||||||
}
|
}
|
||||||
case SelectWrapper::Function_SameGender:
|
case SelectWrapper::Function_SameGender:
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace MWGui
|
||||||
it != store.get<ESM::Cell>().extEnd(); ++it)
|
it != store.get<ESM::Cell>().extEnd(); ++it)
|
||||||
{
|
{
|
||||||
if (!it->mName.empty())
|
if (!it->mName.empty())
|
||||||
mNames.push_back(it->mName);
|
mNames.push_back(it->mName.getRefIdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort
|
// sort
|
||||||
|
|
|
@ -353,7 +353,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
ESM::CellId cellId;
|
ESM::CellId cellId;
|
||||||
cellId.mPaged = !mInterior;
|
cellId.mPaged = !mInterior;
|
||||||
cellId.mWorldspace = (mInterior ? mPrefix : ESM::CellId::sDefaultWorldspace);
|
cellId.mWorldspace = (mInterior ? ESM::RefId::stringRefId(mPrefix) : ESM::CellId::sDefaultWorldspace);
|
||||||
cellId.mIndex.mX = mCurX + dX;
|
cellId.mIndex.mX = mCurX + dX;
|
||||||
cellId.mIndex.mY = mCurY + dY;
|
cellId.mIndex.mY = mCurY + dY;
|
||||||
|
|
||||||
|
@ -637,7 +637,7 @@ namespace MWGui
|
||||||
for (MyGUI::Widget* widget : mExteriorDoorMarkerWidgets)
|
for (MyGUI::Widget* widget : mExteriorDoorMarkerWidgets)
|
||||||
widget->setVisible(false);
|
widget->setVisible(false);
|
||||||
|
|
||||||
MWWorld::CellStore* cell = worldModel->getInterior(mPrefix);
|
MWWorld::CellStore* cell = worldModel->getInterior(ESM::RefId::stringRefId(mPrefix));
|
||||||
world->getDoorMarkers(cell, doors);
|
world->getDoorMarkers(cell, doors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -705,7 +705,7 @@ namespace MWGui
|
||||||
ESM::Position markedPosition;
|
ESM::Position markedPosition;
|
||||||
MWBase::Environment::get().getWorld()->getPlayer().getMarkedPosition(markedCell, markedPosition);
|
MWBase::Environment::get().getWorld()->getPlayer().getMarkedPosition(markedCell, markedPosition);
|
||||||
if (markedCell && markedCell->isExterior() == !mInterior
|
if (markedCell && markedCell->isExterior() == !mInterior
|
||||||
&& (!mInterior || Misc::StringUtils::ciEqual(markedCell->getCell()->mName, mPrefix)))
|
&& (!mInterior || Misc::StringUtils::ciEqual(markedCell->getCell()->mName.getRefIdString(), mPrefix)))
|
||||||
{
|
{
|
||||||
MarkerUserData markerPos(mLocalMapRender);
|
MarkerUserData markerPos(mLocalMapRender);
|
||||||
MyGUI::ImageBox* markerWidget = mLocalMap->createWidget<MyGUI::ImageBox>("ImageBox",
|
MyGUI::ImageBox* markerWidget = mLocalMap->createWidget<MyGUI::ImageBox>("ImageBox",
|
||||||
|
@ -888,7 +888,7 @@ namespace MWGui
|
||||||
|
|
||||||
mEditingMarker.mCell.mPaged = !mInterior;
|
mEditingMarker.mCell.mPaged = !mInterior;
|
||||||
if (mInterior)
|
if (mInterior)
|
||||||
mEditingMarker.mCell.mWorldspace = LocalMapBase::mPrefix;
|
mEditingMarker.mCell.mWorldspace = ESM::RefId::stringRefId(LocalMapBase::mPrefix);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mEditingMarker.mCell.mWorldspace = ESM::CellId::sDefaultWorldspace;
|
mEditingMarker.mCell.mWorldspace = ESM::CellId::sDefaultWorldspace;
|
||||||
|
@ -1333,7 +1333,7 @@ namespace MWGui
|
||||||
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Cell>().search(
|
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Cell>().search(
|
||||||
cellId.first, cellId.second);
|
cellId.first, cellId.second);
|
||||||
if (cell && !cell->mName.empty())
|
if (cell && !cell->mName.empty())
|
||||||
addVisitedLocation(cell->mName, cellId.first, cellId.second);
|
addVisitedLocation(cell->mName.getRefIdString(), cellId.first, cellId.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getWindowManager()->fadeScreenOut(1);
|
MWBase::Environment::get().getWindowManager()->fadeScreenOut(1);
|
||||||
|
|
||||||
// Teleports any followers, too.
|
// Teleports any followers, too.
|
||||||
MWWorld::ActionTeleport action(interior ? cellname.getRefIdString() : "", pos, true);
|
MWWorld::ActionTeleport action(interior ? cellname : ESM::RefId::sEmpty, pos, true);
|
||||||
action.execute(player);
|
action.execute(player);
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->fadeScreenOut(0);
|
MWBase::Environment::get().getWindowManager()->fadeScreenOut(0);
|
||||||
|
|
|
@ -933,7 +933,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mMap->requestMapRender(cell);
|
mMap->requestMapRender(cell);
|
||||||
|
|
||||||
std::string name = std::string(MWBase::Environment::get().getWorld()->getCellName(cell));
|
std::string name = MWBase::Environment::get().getWorld()->getCellName(cell).getRefIdString();
|
||||||
|
|
||||||
mMap->setCellName(name);
|
mMap->setCellName(name);
|
||||||
mHud->setCellName(name);
|
mHud->setCellName(name);
|
||||||
|
@ -949,8 +949,8 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mMap->setCellPrefix(cell->getCell()->mName);
|
mMap->setCellPrefix(cell->getCell()->mName.getRefIdString());
|
||||||
mHud->setCellPrefix(cell->getCell()->mName);
|
mHud->setCellPrefix(cell->getCell()->mName.getRefIdString());
|
||||||
|
|
||||||
osg::Vec3f worldPos;
|
osg::Vec3f worldPos;
|
||||||
if (!MWBase::Environment::get().getWorld()->findInteriorPositionInWorldSpace(cell, worldPos))
|
if (!MWBase::Environment::get().getWorld()->findInteriorPositionInWorldSpace(cell, worldPos))
|
||||||
|
|
|
@ -146,7 +146,7 @@ namespace MWLua
|
||||||
if (esmCell->isExterior())
|
if (esmCell->isExterior())
|
||||||
ai.stack(MWMechanics::AiEscort(refId, gameHoursDuration, dest.x(), dest.y(), dest.z(), false), ptr);
|
ai.stack(MWMechanics::AiEscort(refId, gameHoursDuration, dest.x(), dest.y(), dest.z(), false), ptr);
|
||||||
else
|
else
|
||||||
ai.stack(MWMechanics::AiEscort(refId, ESM::RefId::stringRefId(esmCell->mName), gameHoursDuration,
|
ai.stack(MWMechanics::AiEscort(refId, esmCell->mName, gameHoursDuration,
|
||||||
dest.x(), dest.y(), dest.z(), false),
|
dest.x(), dest.y(), dest.z(), false),
|
||||||
ptr);
|
ptr);
|
||||||
};
|
};
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace MWLua
|
||||||
WorldView* worldView = context.mWorldView;
|
WorldView* worldView = context.mWorldView;
|
||||||
addTimeBindings(api, context, true);
|
addTimeBindings(api, context, true);
|
||||||
api["getCellByName"] = [worldView = context.mWorldView](const std::string& name) -> sol::optional<GCell> {
|
api["getCellByName"] = [worldView = context.mWorldView](const std::string& name) -> sol::optional<GCell> {
|
||||||
MWWorld::CellStore* cell = worldView->findNamedCell(name);
|
MWWorld::CellStore* cell = worldView->findNamedCell(ESM::RefId::stringRefId(name));
|
||||||
if (cell)
|
if (cell)
|
||||||
return GCell{ cell };
|
return GCell{ cell };
|
||||||
else
|
else
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace MWLua
|
||||||
class TeleportAction final : public LuaManager::Action
|
class TeleportAction final : public LuaManager::Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TeleportAction(LuaUtil::LuaState* state, ObjectId object, std::string cell, const osg::Vec3f& pos,
|
TeleportAction(LuaUtil::LuaState* state, ObjectId object, ESM::RefId cell, const osg::Vec3f& pos,
|
||||||
const osg::Vec3f& rot)
|
const osg::Vec3f& rot)
|
||||||
: Action(state)
|
: Action(state)
|
||||||
, mObject(object)
|
, mObject(object)
|
||||||
|
@ -65,7 +65,7 @@ namespace MWLua
|
||||||
{
|
{
|
||||||
MWWorld::CellStore* cell = worldView.findCell(mCell, mPos);
|
MWWorld::CellStore* cell = worldView.findCell(mCell, mPos);
|
||||||
if (!cell)
|
if (!cell)
|
||||||
throw std::runtime_error(std::string("cell not found: '") + mCell + "'");
|
throw std::runtime_error(std::string("cell not found: '") + mCell.getRefIdString() + "'");
|
||||||
|
|
||||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr obj = worldView.getObjectRegistry()->getPtr(mObject, false);
|
MWWorld::Ptr obj = worldView.getObjectRegistry()->getPtr(mObject, false);
|
||||||
|
@ -96,7 +96,7 @@ namespace MWLua
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ObjectId mObject;
|
ObjectId mObject;
|
||||||
std::string mCell;
|
ESM::RefId mCell;
|
||||||
osg::Vec3f mPos;
|
osg::Vec3f mPos;
|
||||||
osg::Vec3f mRot;
|
osg::Vec3f mRot;
|
||||||
};
|
};
|
||||||
|
@ -247,7 +247,7 @@ namespace MWLua
|
||||||
MWWorld::Ptr ptr = object.ptr();
|
MWWorld::Ptr ptr = object.ptr();
|
||||||
osg::Vec3f rot = optRot ? *optRot : ptr.getRefData().getPosition().asRotationVec3();
|
osg::Vec3f rot = optRot ? *optRot : ptr.getRefData().getPosition().asRotationVec3();
|
||||||
auto action
|
auto action
|
||||||
= std::make_unique<TeleportAction>(context.mLua, object.id(), std::string(cell), pos, rot);
|
= std::make_unique<TeleportAction>(context.mLua, object.id(), ESM::RefId::stringRefId(cell), pos, rot);
|
||||||
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
||||||
context.mLuaManager->addTeleportPlayerAction(std::move(action));
|
context.mLuaManager->addTeleportPlayerAction(std::move(action));
|
||||||
else
|
else
|
||||||
|
|
|
@ -125,7 +125,7 @@ namespace MWLua
|
||||||
|
|
||||||
// TODO: If Lua scripts will use several threads at the same time, then `find*Cell` functions should have critical
|
// TODO: If Lua scripts will use several threads at the same time, then `find*Cell` functions should have critical
|
||||||
// sections.
|
// sections.
|
||||||
MWWorld::CellStore* WorldView::findCell(const std::string& name, osg::Vec3f position)
|
MWWorld::CellStore* WorldView::findCell(const ESM::RefId& name, osg::Vec3f position)
|
||||||
{
|
{
|
||||||
MWWorld::WorldModel* worldModel = MWBase::Environment::get().getWorldModel();
|
MWWorld::WorldModel* worldModel = MWBase::Environment::get().getWorldModel();
|
||||||
bool exterior = name.empty() || MWBase::Environment::get().getWorld()->getExterior(name);
|
bool exterior = name.empty() || MWBase::Environment::get().getWorld()->getExterior(name);
|
||||||
|
@ -138,7 +138,7 @@ namespace MWLua
|
||||||
return worldModel->getInterior(name);
|
return worldModel->getInterior(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::CellStore* WorldView::findNamedCell(const std::string& name)
|
MWWorld::CellStore* WorldView::findNamedCell(const ESM::RefId& name)
|
||||||
{
|
{
|
||||||
MWWorld::WorldModel* worldModel = MWBase::Environment::get().getWorldModel();
|
MWWorld::WorldModel* worldModel = MWBase::Environment::get().getWorldModel();
|
||||||
const ESM::Cell* esmCell = MWBase::Environment::get().getWorld()->getExterior(name);
|
const ESM::Cell* esmCell = MWBase::Environment::get().getWorld()->getExterior(name);
|
||||||
|
|
|
@ -54,8 +54,8 @@ namespace MWLua
|
||||||
// If onlyActive = true, then search only among the objects that are currently in the scene.
|
// If onlyActive = true, then search only among the objects that are currently in the scene.
|
||||||
// TODO: ObjectIdList selectObjects(const Queries::Query& query, bool onlyActive);
|
// TODO: ObjectIdList selectObjects(const Queries::Query& query, bool onlyActive);
|
||||||
|
|
||||||
MWWorld::CellStore* findCell(const std::string& name, osg::Vec3f position);
|
MWWorld::CellStore* findCell(const ESM::RefId& name, osg::Vec3f position);
|
||||||
MWWorld::CellStore* findNamedCell(const std::string& name);
|
MWWorld::CellStore* findNamedCell(const ESM::RefId& name);
|
||||||
MWWorld::CellStore* findExteriorCell(int x, int y);
|
MWWorld::CellStore* findExteriorCell(int x, int y);
|
||||||
|
|
||||||
void load(ESM::ESMReader& esm);
|
void load(ESM::ESMReader& esm);
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mCellId.empty() && mCellId.getRefIdString() != actor.getCell()->getCell()->getCellId().mWorldspace)
|
if (!mCellId.empty() && mCellId != actor.getCell()->getCell()->getCellId().mWorldspace)
|
||||||
return false; // Not in the correct cell, pause and rely on the player to go back through a teleport door
|
return false; // Not in the correct cell, pause and rely on the player to go back through a teleport door
|
||||||
|
|
||||||
actor.getClass().getCreatureStats(actor).setDrawState(DrawState::Nothing);
|
actor.getClass().getCreatureStats(actor).setDrawState(DrawState::Nothing);
|
||||||
|
|
|
@ -175,7 +175,7 @@ namespace MWMechanics
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mCellId.getRefIdString() == actor.getCell()->getCell()->mName) // Cell to travel to
|
else if (mCellId == actor.getCell()->getCell()->mName) // Cell to travel to
|
||||||
{
|
{
|
||||||
mRemainingDuration = mDuration;
|
mRemainingDuration = mDuration;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -489,8 +489,8 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
ESM::RefId dest;
|
ESM::RefId dest;
|
||||||
if (!markedCell->isExterior())
|
if (!markedCell->isExterior())
|
||||||
dest = ESM::RefId::stringRefId(markedCell->getCell()->mName);
|
dest = markedCell->getCell()->mName;
|
||||||
MWWorld::ActionTeleport action(dest.getRefIdString(), markedPosition, false);
|
MWWorld::ActionTeleport action(dest, markedPosition, false);
|
||||||
action.execute(target);
|
action.execute(target);
|
||||||
if (!caster.isEmpty())
|
if (!caster.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace MWScript
|
||||||
public:
|
public:
|
||||||
void execute(Interpreter::Runtime& runtime) override
|
void execute(Interpreter::Runtime& runtime) override
|
||||||
{
|
{
|
||||||
std::string_view cell = runtime.getStringLiteral(runtime[0].mInteger);
|
const ESM::RefId cell = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger));
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
ESM::Position pos;
|
ESM::Position pos;
|
||||||
|
@ -165,7 +165,7 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
const MWWorld::CellStore* cell = MWMechanics::getPlayer().getCell();
|
const MWWorld::CellStore* cell = MWMechanics::getPlayer().getCell();
|
||||||
|
|
||||||
std::string_view current = MWBase::Environment::get().getWorld()->getCellName(cell);
|
std::string_view current = MWBase::Environment::get().getWorld()->getCellName(cell).getRefIdString();
|
||||||
bool match = Misc::StringUtils::ciCompareLen(name, current, name.length()) == 0;
|
bool match = Misc::StringUtils::ciCompareLen(name, current, name.length()) == 0;
|
||||||
|
|
||||||
runtime.push(match ? 1 : 0);
|
runtime.push(match ? 1 : 0);
|
||||||
|
|
|
@ -126,8 +126,9 @@ namespace MWScript
|
||||||
|
|
||||||
for (auto it = cells.extBegin(); it != cells.extEnd(); ++it)
|
for (auto it = cells.extBegin(); it != cells.extEnd(); ++it)
|
||||||
{
|
{
|
||||||
if (Misc::StringUtils::ciStartsWith(it->mName, cell))
|
const auto& cellName = it->mName.getRefIdString();
|
||||||
winMgr->addVisitedLocation(it->mName, it->getGridX(), it->getGridY());
|
if (Misc::StringUtils::ciStartsWith(cellName, cell))
|
||||||
|
winMgr->addVisitedLocation(cellName, it->getGridX(), it->getGridY());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -142,7 +143,7 @@ namespace MWScript
|
||||||
|
|
||||||
for (auto it = cells.extBegin(); it != cells.extEnd(); ++it)
|
for (auto it = cells.extBegin(); it != cells.extEnd(); ++it)
|
||||||
{
|
{
|
||||||
const std::string& name = it->mName;
|
const std::string& name = it->mName.getRefIdString();
|
||||||
if (!name.empty())
|
if (!name.empty())
|
||||||
MWBase::Environment::get().getWindowManager()->addVisitedLocation(
|
MWBase::Environment::get().getWindowManager()->addVisitedLocation(
|
||||||
name, it->getGridX(), it->getGridY());
|
name, it->getGridX(), it->getGridY());
|
||||||
|
|
|
@ -414,7 +414,7 @@ namespace MWScript
|
||||||
|
|
||||||
std::string_view InterpreterContext::getCurrentCellName() const
|
std::string_view InterpreterContext::getCurrentCellName() const
|
||||||
{
|
{
|
||||||
return MWBase::Environment::get().getWorld()->getCellName();
|
return MWBase::Environment::get().getWorld()->getCellName().getRefIdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterContext::executeActivation(const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor)
|
void InterpreterContext::executeActivation(const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor)
|
||||||
|
|
|
@ -382,7 +382,7 @@ namespace MWScript
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
Interpreter::Type_Float zRot = runtime[0].mFloat;
|
Interpreter::Type_Float zRot = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
std::string_view cellID = runtime.getStringLiteral(runtime[0].mInteger);
|
const ESM::RefId cellID = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger));
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
if (ptr.getContainerStore())
|
if (ptr.getContainerStore())
|
||||||
|
@ -409,7 +409,7 @@ namespace MWScript
|
||||||
if (!cell)
|
if (!cell)
|
||||||
{
|
{
|
||||||
std::string error
|
std::string error
|
||||||
= "Warning: PositionCell: unknown interior cell (" + std::string(cellID) + ")";
|
= "Warning: PositionCell: unknown interior cell (" + cellID.getRefIdString() + ")";
|
||||||
if (isPlayer)
|
if (isPlayer)
|
||||||
error += ", moving to exterior instead";
|
error += ", moving to exterior instead";
|
||||||
runtime.getContext().report(error);
|
runtime.getContext().report(error);
|
||||||
|
@ -504,7 +504,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
const ESM::RefId itemID = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger));
|
const ESM::RefId itemID = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger));
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
std::string_view cellID = runtime.getStringLiteral(runtime[0].mInteger);
|
auto cellID = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger));
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
Interpreter::Type_Float x = runtime[0].mFloat;
|
Interpreter::Type_Float x = runtime[0].mFloat;
|
||||||
|
@ -528,7 +528,7 @@ namespace MWScript
|
||||||
store = MWBase::Environment::get().getWorldModel()->getExterior(cellIndex.x(), cellIndex.y());
|
store = MWBase::Environment::get().getWorldModel()->getExterior(cellIndex.x(), cellIndex.y());
|
||||||
if (!cell)
|
if (!cell)
|
||||||
{
|
{
|
||||||
runtime.getContext().report("unknown cell (" + std::string(cellID) + ")");
|
runtime.getContext().report("unknown cell (" + cellID.getRefIdString() + ")");
|
||||||
Log(Debug::Error) << "Error: unknown cell (" << cellID << ")";
|
Log(Debug::Error) << "Error: unknown cell (" << cellID << ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,7 @@ void MWState::StateManager::saveGame(const std::string& description, const Slot*
|
||||||
else
|
else
|
||||||
profile.mPlayerClassId = classId;
|
profile.mPlayerClassId = classId;
|
||||||
|
|
||||||
profile.mPlayerCell = ESM::RefId::stringRefId(world.getCellName());
|
profile.mPlayerCell = world.getCellName();
|
||||||
profile.mInGameTime = world.getEpochTimeStamp();
|
profile.mInGameTime = world.getEpochTimeStamp();
|
||||||
profile.mTimePlayed = mTimePlayed;
|
profile.mTimePlayed = mTimePlayed;
|
||||||
profile.mDescription = description;
|
profile.mDescription = description;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
{
|
{
|
||||||
ActionTeleport::ActionTeleport(std::string_view cellName, const ESM::Position& position, bool teleportFollowers)
|
ActionTeleport::ActionTeleport(const ESM::RefId& cellName, const ESM::Position& position, bool teleportFollowers)
|
||||||
: Action(true)
|
: Action(true)
|
||||||
, mCellName(cellName)
|
, mCellName(cellName)
|
||||||
, mPosition(position)
|
, mPosition(position)
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
class ActionTeleport : public Action
|
class ActionTeleport : public Action
|
||||||
{
|
{
|
||||||
std::string mCellName;
|
ESM::RefId mCellName;
|
||||||
ESM::Position mPosition;
|
ESM::Position mPosition;
|
||||||
bool mTeleportFollowers;
|
bool mTeleportFollowers;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace MWWorld
|
||||||
public:
|
public:
|
||||||
/// If cellName is empty, an exterior cell is assumed.
|
/// If cellName is empty, an exterior cell is assumed.
|
||||||
/// @param teleportFollowers Whether to teleport any following actors of the target actor as well.
|
/// @param teleportFollowers Whether to teleport any following actors of the target actor as well.
|
||||||
ActionTeleport(std::string_view cellName, const ESM::Position& position, bool teleportFollowers);
|
ActionTeleport(const ESM::RefId& cellName, const ESM::Position& position, bool teleportFollowers);
|
||||||
|
|
||||||
/// @param includeHostiles If true, include hostile followers (which won't actually be teleported) in the
|
/// @param includeHostiles If true, include hostile followers (which won't actually be teleported) in the
|
||||||
/// output,
|
/// output,
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace MWWorld
|
||||||
const ESM::Position& getDoorDest() const { return mCellRef.mDoorDest; }
|
const ESM::Position& getDoorDest() const { return mCellRef.mDoorDest; }
|
||||||
|
|
||||||
// Destination cell for doors (optional)
|
// Destination cell for doors (optional)
|
||||||
const std::string& getDestCell() const { return mCellRef.mDestCell; }
|
const ESM::RefId& getDestCell() const { return mCellRef.mDestCell; }
|
||||||
|
|
||||||
// Scale applied to mesh
|
// Scale applied to mesh
|
||||||
float getScale() const { return mCellRef.mScale; }
|
float getScale() const { return mCellRef.mScale; }
|
||||||
|
|
|
@ -462,7 +462,7 @@ namespace MWWorld
|
||||||
// interior cell -> need to check if it exists (exterior cell will be
|
// interior cell -> need to check if it exists (exterior cell will be
|
||||||
// generated on the fly)
|
// generated on the fly)
|
||||||
|
|
||||||
if (!world.getStore().get<ESM::Cell>().search(ESM::RefId::stringRefId(player.mMarkedCell.mWorldspace)))
|
if (!world.getStore().get<ESM::Cell>().search(player.mMarkedCell.mWorldspace))
|
||||||
player.mHasMark = false; // drop mark silently
|
player.mHasMark = false; // drop mark silently
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -841,7 +841,7 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::changeToInteriorCell(
|
void Scene::changeToInteriorCell(
|
||||||
const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent)
|
const ESM::RefId& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent)
|
||||||
{
|
{
|
||||||
CellStore* cell = mWorld.getWorldModel().getInterior(cellName);
|
CellStore* cell = mWorld.getWorldModel().getInterior(cellName);
|
||||||
bool useFading = (mCurrentCell != nullptr);
|
bool useFading = (mCurrentCell != nullptr);
|
||||||
|
|
|
@ -163,7 +163,7 @@ namespace MWWorld
|
||||||
void resetCellLoaded() { mCellLoaded = false; }
|
void resetCellLoaded() { mCellLoaded = false; }
|
||||||
|
|
||||||
void changeToInteriorCell(
|
void changeToInteriorCell(
|
||||||
const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true);
|
const ESM::RefId& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true);
|
||||||
///< Move to interior cell.
|
///< Move to interior cell.
|
||||||
/// @param changeEvent Set cellChanged flag?
|
/// @param changeEvent Set cellChanged flag?
|
||||||
|
|
||||||
|
|
|
@ -455,7 +455,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
return search(cell.getGridX(), cell.getGridY());
|
return search(cell.getGridX(), cell.getGridY());
|
||||||
}
|
}
|
||||||
return search(ESM::RefId::stringRefId(cell.mName));
|
return search(cell.mName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this method *must* be called right after esm3.loadCell()
|
// this method *must* be called right after esm3.loadCell()
|
||||||
|
@ -613,7 +613,7 @@ namespace MWWorld
|
||||||
if (cell.mData.mFlags & ESM::Cell::Interior)
|
if (cell.mData.mFlags & ESM::Cell::Interior)
|
||||||
{
|
{
|
||||||
// Store interior cell by name, try to merge with existing parent data.
|
// Store interior cell by name, try to merge with existing parent data.
|
||||||
ESM::Cell* oldcell = const_cast<ESM::Cell*>(search(ESM::RefId::stringRefId(cell.mName)));
|
ESM::Cell* oldcell = const_cast<ESM::Cell*>(search(cell.mName));
|
||||||
if (oldcell)
|
if (oldcell)
|
||||||
{
|
{
|
||||||
// merge new cell into old cell
|
// merge new cell into old cell
|
||||||
|
@ -628,7 +628,7 @@ namespace MWWorld
|
||||||
// spawn a new cell
|
// spawn a new cell
|
||||||
cell.loadCell(esm, true);
|
cell.loadCell(esm, true);
|
||||||
|
|
||||||
mInt[ESM::RefId::stringRefId(cell.mName)] = cell;
|
mInt[cell.mName] = cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -693,7 +693,7 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return RecordId(ESM::RefId::stringRefId(cell.mName), isDeleted);
|
return RecordId(cell.mName, isDeleted);
|
||||||
}
|
}
|
||||||
Store<ESM::Cell>::iterator Store<ESM::Cell>::intBegin() const
|
Store<ESM::Cell>::iterator Store<ESM::Cell>::intBegin() const
|
||||||
{
|
{
|
||||||
|
@ -716,7 +716,7 @@ namespace MWWorld
|
||||||
const ESM::Cell* cell = nullptr;
|
const ESM::Cell* cell = nullptr;
|
||||||
for (const ESM::Cell* sharedCell : mSharedExt)
|
for (const ESM::Cell* sharedCell : mSharedExt)
|
||||||
{
|
{
|
||||||
if (ESM::RefId::stringRefId(sharedCell->mName) == id)
|
if (sharedCell->mName == id)
|
||||||
{
|
{
|
||||||
if (cell == nullptr || (sharedCell->mData.mX > cell->mData.mX)
|
if (cell == nullptr || (sharedCell->mData.mX > cell->mData.mX)
|
||||||
|| (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY))
|
|| (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY))
|
||||||
|
@ -761,7 +761,7 @@ namespace MWWorld
|
||||||
|
|
||||||
for (const ESM::Cell* sharedCell : mSharedInt)
|
for (const ESM::Cell* sharedCell : mSharedInt)
|
||||||
{
|
{
|
||||||
list.push_back(ESM::RefId::stringRefId(sharedCell->mName));
|
list.push_back(sharedCell->mName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESM::Cell* Store<ESM::Cell>::insert(const ESM::Cell& cell)
|
ESM::Cell* Store<ESM::Cell>::insert(const ESM::Cell& cell)
|
||||||
|
@ -783,7 +783,7 @@ namespace MWWorld
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// duplicate insertions are avoided by search(ESM::Cell &)
|
// duplicate insertions are avoided by search(ESM::Cell &)
|
||||||
DynamicInt::iterator result = mDynamicInt.emplace(ESM::RefId::stringRefId(cell.mName), cell).first;
|
DynamicInt::iterator result = mDynamicInt.emplace(cell.mName, cell).first;
|
||||||
mSharedInt.push_back(&result->second);
|
mSharedInt.push_back(&result->second);
|
||||||
return &result->second;
|
return &result->second;
|
||||||
}
|
}
|
||||||
|
@ -794,7 +794,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
return erase(cell.getGridX(), cell.getGridY());
|
return erase(cell.getGridX(), cell.getGridY());
|
||||||
}
|
}
|
||||||
return erase(ESM::RefId::stringRefId(cell.mName));
|
return erase(cell.mName);
|
||||||
}
|
}
|
||||||
bool Store<ESM::Cell>::erase(const ESM::RefId& id)
|
bool Store<ESM::Cell>::erase(const ESM::RefId& id)
|
||||||
{
|
{
|
||||||
|
@ -942,14 +942,14 @@ namespace MWWorld
|
||||||
if (!(cell.mData.mFlags & ESM::Cell::Interior))
|
if (!(cell.mData.mFlags & ESM::Cell::Interior))
|
||||||
return search(cell.mData.mX, cell.mData.mY);
|
return search(cell.mData.mX, cell.mData.mY);
|
||||||
else
|
else
|
||||||
return search(ESM::RefId::stringRefId(cell.mName));
|
return search(cell.mName);
|
||||||
}
|
}
|
||||||
const ESM::Pathgrid* Store<ESM::Pathgrid>::find(const ESM::Cell& cell) const
|
const ESM::Pathgrid* Store<ESM::Pathgrid>::find(const ESM::Cell& cell) const
|
||||||
{
|
{
|
||||||
if (!(cell.mData.mFlags & ESM::Cell::Interior))
|
if (!(cell.mData.mFlags & ESM::Cell::Interior))
|
||||||
return find(cell.mData.mX, cell.mData.mY);
|
return find(cell.mData.mX, cell.mData.mY);
|
||||||
else
|
else
|
||||||
return find(ESM::RefId::stringRefId(cell.mName));
|
return find(cell.mName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skill
|
// Skill
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace MWWorld
|
||||||
World::World(osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode, Resource::ResourceSystem* resourceSystem,
|
World::World(osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode, Resource::ResourceSystem* resourceSystem,
|
||||||
SceneUtil::WorkQueue* workQueue, SceneUtil::UnrefQueue& unrefQueue, const Files::Collections& fileCollections,
|
SceneUtil::WorkQueue* workQueue, SceneUtil::UnrefQueue& unrefQueue, const Files::Collections& fileCollections,
|
||||||
const std::vector<std::string>& contentFiles, const std::vector<std::string>& groundcoverFiles,
|
const std::vector<std::string>& contentFiles, const std::vector<std::string>& groundcoverFiles,
|
||||||
ToUTF8::Utf8Encoder* encoder, int activationDistanceOverride, const std::string& startCell,
|
ToUTF8::Utf8Encoder* encoder, int activationDistanceOverride, const ESM::RefId& startCell,
|
||||||
const std::string& startupScript, const std::filesystem::path& resourcePath,
|
const std::string& startupScript, const std::filesystem::path& resourcePath,
|
||||||
const std::filesystem::path& userDataPath)
|
const std::filesystem::path& userDataPath)
|
||||||
: mResourceSystem(resourceSystem)
|
: mResourceSystem(resourceSystem)
|
||||||
|
@ -565,15 +565,15 @@ namespace MWWorld
|
||||||
mRandomSeed = seed;
|
mRandomSeed = seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ESM::Cell* World::getExterior(std::string_view cellName) const
|
const ESM::Cell* World::getExterior(const ESM::RefId& cellName) const
|
||||||
{
|
{
|
||||||
// first try named cells
|
// first try named cells
|
||||||
const ESM::Cell* cell = mStore.get<ESM::Cell>().searchExtByName(ESM::RefId::stringRefId(cellName));
|
const ESM::Cell* cell = mStore.get<ESM::Cell>().searchExtByName(cellName);
|
||||||
if (cell)
|
if (cell)
|
||||||
return cell;
|
return cell;
|
||||||
// treat "Wilderness" like an empty string
|
// treat "Wilderness" like an empty string
|
||||||
const std::string defaultName = mStore.get<ESM::GameSetting>().find("sDefaultCellname")->mValue.getString();
|
const ESM::RefId defaultName = ESM::RefId::stringRefId(mStore.get<ESM::GameSetting>().find("sDefaultCellname")->mValue.getString());
|
||||||
if (Misc::StringUtils::ciEqual(cellName, defaultName))
|
if (cellName == defaultName)
|
||||||
{
|
{
|
||||||
cell = mStore.get<ESM::Cell>().searchExtByName(ESM::RefId::sEmpty);
|
cell = mStore.get<ESM::Cell>().searchExtByName(ESM::RefId::sEmpty);
|
||||||
if (cell)
|
if (cell)
|
||||||
|
@ -583,7 +583,7 @@ namespace MWWorld
|
||||||
// didn't work -> now check for regions
|
// didn't work -> now check for regions
|
||||||
for (const ESM::Region& region : mStore.get<ESM::Region>())
|
for (const ESM::Region& region : mStore.get<ESM::Region>())
|
||||||
{
|
{
|
||||||
if (Misc::StringUtils::ciEqual(cellName, region.mName))
|
if (Misc::StringUtils::ciEqual(cellName.getRefIdString(), region.mName))
|
||||||
{
|
{
|
||||||
return mStore.get<ESM::Cell>().searchExtByRegion(region.mId);
|
return mStore.get<ESM::Cell>().searchExtByRegion(region.mId);
|
||||||
}
|
}
|
||||||
|
@ -655,14 +655,14 @@ namespace MWWorld
|
||||||
return mCurrentDate->getMonthName(month);
|
return mCurrentDate->getMonthName(month);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view World::getCellName(const MWWorld::CellStore* cell) const
|
const ESM::RefId& World::getCellName(const MWWorld::CellStore* cell) const
|
||||||
{
|
{
|
||||||
if (!cell)
|
if (!cell)
|
||||||
cell = mWorldScene->getCurrentCell();
|
cell = mWorldScene->getCurrentCell();
|
||||||
return getCellName(cell->getCell());
|
return getCellName(cell->getCell());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view World::getCellName(const ESM::Cell* cell) const
|
const ESM::RefId World::getCellName(const ESM::Cell* cell) const
|
||||||
{
|
{
|
||||||
if (cell)
|
if (cell)
|
||||||
{
|
{
|
||||||
|
@ -670,9 +670,9 @@ namespace MWWorld
|
||||||
return cell->mName;
|
return cell->mName;
|
||||||
|
|
||||||
if (const ESM::Region* region = mStore.get<ESM::Region>().search(cell->mRegion))
|
if (const ESM::Region* region = mStore.get<ESM::Region>().search(cell->mRegion))
|
||||||
return region->mName;
|
return ESM::RefId::stringRefId( region->mName);
|
||||||
}
|
}
|
||||||
return mStore.get<ESM::GameSetting>().find("sDefaultCellname")->mValue.getString();
|
return ESM::RefId::stringRefId(mStore.get<ESM::GameSetting>().find("sDefaultCellname")->mValue.getString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::removeRefScript(MWWorld::RefData* ref)
|
void World::removeRefScript(MWWorld::RefData* ref)
|
||||||
|
@ -954,12 +954,12 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::changeToInteriorCell(
|
void World::changeToInteriorCell(
|
||||||
const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent)
|
const ESM::RefId& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent)
|
||||||
{
|
{
|
||||||
mPhysics->clearQueuedMovement();
|
mPhysics->clearQueuedMovement();
|
||||||
mDiscardMovements = true;
|
mDiscardMovements = true;
|
||||||
|
|
||||||
if (changeEvent && !Misc::StringUtils::ciEqual(mCurrentWorldSpace, cellName))
|
if (changeEvent && mCurrentWorldSpace != cellName)
|
||||||
{
|
{
|
||||||
// changed worldspace
|
// changed worldspace
|
||||||
mProjectileManager->clear();
|
mProjectileManager->clear();
|
||||||
|
@ -1421,10 +1421,10 @@ namespace MWWorld
|
||||||
esmPos.pos[0] = traced.x();
|
esmPos.pos[0] = traced.x();
|
||||||
esmPos.pos[1] = traced.y();
|
esmPos.pos[1] = traced.y();
|
||||||
esmPos.pos[2] = traced.z();
|
esmPos.pos[2] = traced.z();
|
||||||
std::string_view cell;
|
const ESM::RefId* cell;
|
||||||
if (!actor.getCell()->isExterior())
|
if (!actor.getCell()->isExterior())
|
||||||
cell = actor.getCell()->getCell()->mName;
|
cell = &actor.getCell()->getCell()->mName;
|
||||||
MWWorld::ActionTeleport(cell, esmPos, false).execute(actor);
|
MWWorld::ActionTeleport(*cell, esmPos, false).execute(actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2782,7 +2782,7 @@ namespace MWWorld
|
||||||
physicActor->enableCollisionBody(enable);
|
physicActor->enableCollisionBody(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool World::findInteriorPosition(std::string_view name, ESM::Position& pos)
|
bool World::findInteriorPosition(const ESM::RefId& name, ESM::Position& pos)
|
||||||
{
|
{
|
||||||
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
||||||
pos.pos[0] = pos.pos[1] = pos.pos[2] = 0;
|
pos.pos[0] = pos.pos[1] = pos.pos[2] = 0;
|
||||||
|
@ -2831,7 +2831,7 @@ namespace MWWorld
|
||||||
// and use its destination to position inside cell.
|
// and use its destination to position inside cell.
|
||||||
for (const MWWorld::LiveCellRef<ESM::Door>& destDoor : source->getReadOnlyDoors().mList)
|
for (const MWWorld::LiveCellRef<ESM::Door>& destDoor : source->getReadOnlyDoors().mList)
|
||||||
{
|
{
|
||||||
if (Misc::StringUtils::ciEqual(name, destDoor.mRef.getDestCell()))
|
if (name == destDoor.mRef.getDestCell())
|
||||||
{
|
{
|
||||||
/// \note Using _any_ door pointed to the interior,
|
/// \note Using _any_ door pointed to the interior,
|
||||||
/// not the one pointed to current door.
|
/// not the one pointed to current door.
|
||||||
|
@ -2854,11 +2854,11 @@ namespace MWWorld
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool World::findExteriorPosition(std::string_view name, ESM::Position& pos)
|
bool World::findExteriorPosition(const ESM::RefId& nameId, ESM::Position& pos)
|
||||||
{
|
{
|
||||||
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
||||||
|
const std::string& name = nameId.getRefIdString();
|
||||||
const ESM::Cell* ext = getExterior(name);
|
const ESM::Cell* ext = getExterior(nameId);
|
||||||
if (!ext)
|
if (!ext)
|
||||||
{
|
{
|
||||||
size_t comma = name.find(',');
|
size_t comma = name.find(',');
|
||||||
|
@ -3278,9 +3278,9 @@ namespace MWWorld
|
||||||
|
|
||||||
// Search for a 'nearest' exterior, counting each cell between the starting
|
// Search for a 'nearest' exterior, counting each cell between the starting
|
||||||
// cell and the exterior as a distance of 1. Will fail for isolated interiors.
|
// cell and the exterior as a distance of 1. Will fail for isolated interiors.
|
||||||
std::set<std::string> checkedCells;
|
std::set<ESM::RefId> checkedCells;
|
||||||
std::set<std::string> currentCells;
|
std::set<ESM::RefId> currentCells;
|
||||||
std::set<std::string> nextCells;
|
std::set<ESM::RefId> nextCells;
|
||||||
nextCells.insert(cell->getCell()->mName);
|
nextCells.insert(cell->getCell()->mName);
|
||||||
|
|
||||||
while (!nextCells.empty())
|
while (!nextCells.empty())
|
||||||
|
@ -3307,7 +3307,7 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const std::string& dest = ref.mRef.getDestCell();
|
const ESM::RefId& dest = ref.mRef.getDestCell();
|
||||||
if (!checkedCells.count(dest) && !currentCells.count(dest))
|
if (!checkedCells.count(dest) && !currentCells.count(dest))
|
||||||
nextCells.insert(dest);
|
nextCells.insert(dest);
|
||||||
}
|
}
|
||||||
|
@ -3331,9 +3331,9 @@ namespace MWWorld
|
||||||
// Search for a 'nearest' marker, counting each cell between the starting
|
// Search for a 'nearest' marker, counting each cell between the starting
|
||||||
// cell and the exterior as a distance of 1. If an exterior is found, jump
|
// cell and the exterior as a distance of 1. If an exterior is found, jump
|
||||||
// to the nearest exterior marker, without further interior searching.
|
// to the nearest exterior marker, without further interior searching.
|
||||||
std::set<std::string> checkedCells;
|
std::set<ESM::RefId> checkedCells;
|
||||||
std::set<std::string> currentCells;
|
std::set<ESM::RefId> currentCells;
|
||||||
std::set<std::string> nextCells;
|
std::set<ESM::RefId> nextCells;
|
||||||
MWWorld::ConstPtr closestMarker;
|
MWWorld::ConstPtr closestMarker;
|
||||||
|
|
||||||
nextCells.insert(ptr.getCell()->getCell()->mName);
|
nextCells.insert(ptr.getCell()->getCell()->mName);
|
||||||
|
@ -3429,11 +3429,11 @@ namespace MWWorld
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view cellName;
|
const ESM::RefId* cellName;
|
||||||
if (!closestMarker.mCell->isExterior())
|
if (!closestMarker.mCell->isExterior())
|
||||||
cellName = closestMarker.mCell->getCell()->mName;
|
cellName = &closestMarker.mCell->getCell()->mName;
|
||||||
|
|
||||||
MWWorld::ActionTeleport action(cellName, closestMarker.getRefData().getPosition(), false);
|
MWWorld::ActionTeleport action(*cellName, closestMarker.getRefData().getPosition(), false);
|
||||||
action.execute(ptr);
|
action.execute(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3635,7 +3635,7 @@ namespace MWWorld
|
||||||
Log(Debug::Warning) << "Failed to confiscate items: no closest prison marker found.";
|
Log(Debug::Warning) << "Failed to confiscate items: no closest prison marker found.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const std::string& prisonName = prisonMarker.getCellRef().getDestCell();
|
const ESM::RefId& prisonName = prisonMarker.getCellRef().getDestCell();
|
||||||
if (prisonName.empty())
|
if (prisonName.empty())
|
||||||
{
|
{
|
||||||
Log(Debug::Warning) << "Failed to confiscate items: prison marker not linked to prison interior";
|
Log(Debug::Warning) << "Failed to confiscate items: prison marker not linked to prison interior";
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace MWWorld
|
||||||
WorldModel mWorldModel;
|
WorldModel mWorldModel;
|
||||||
std::vector<int> mESMVersions; // the versions of esm files
|
std::vector<int> mESMVersions; // the versions of esm files
|
||||||
|
|
||||||
std::string mCurrentWorldSpace;
|
ESM::RefId mCurrentWorldSpace;
|
||||||
|
|
||||||
std::unique_ptr<MWWorld::Player> mPlayer;
|
std::unique_ptr<MWWorld::Player> mPlayer;
|
||||||
std::unique_ptr<MWPhysics::PhysicsSystem> mPhysics;
|
std::unique_ptr<MWPhysics::PhysicsSystem> mPhysics;
|
||||||
|
@ -118,7 +118,7 @@ namespace MWWorld
|
||||||
|
|
||||||
int mActivationDistanceOverride;
|
int mActivationDistanceOverride;
|
||||||
|
|
||||||
std::string mStartCell;
|
ESM::RefId mStartCell;
|
||||||
|
|
||||||
float mSwimHeightScale;
|
float mSwimHeightScale;
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ namespace MWWorld
|
||||||
SceneUtil::WorkQueue* workQueue, SceneUtil::UnrefQueue& unrefQueue,
|
SceneUtil::WorkQueue* workQueue, SceneUtil::UnrefQueue& unrefQueue,
|
||||||
const Files::Collections& fileCollections, const std::vector<std::string>& contentFiles,
|
const Files::Collections& fileCollections, const std::vector<std::string>& contentFiles,
|
||||||
const std::vector<std::string>& groundcoverFiles, ToUTF8::Utf8Encoder* encoder,
|
const std::vector<std::string>& groundcoverFiles, ToUTF8::Utf8Encoder* encoder,
|
||||||
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript,
|
int activationDistanceOverride, const ESM::RefId& startCell, const std::string& startupScript,
|
||||||
const std::filesystem::path& resourcePath, const std::filesystem::path& userDataPath);
|
const std::filesystem::path& resourcePath, const std::filesystem::path& userDataPath);
|
||||||
|
|
||||||
virtual ~World();
|
virtual ~World();
|
||||||
|
@ -267,12 +267,12 @@ namespace MWWorld
|
||||||
char getGlobalVariableType(std::string_view name) const override;
|
char getGlobalVariableType(std::string_view name) const override;
|
||||||
///< Return ' ', if there is no global variable with this name.
|
///< Return ' ', if there is no global variable with this name.
|
||||||
|
|
||||||
std::string_view getCellName(const MWWorld::CellStore* cell = nullptr) const override;
|
const ESM::RefId& getCellName(const MWWorld::CellStore* cell = nullptr) const override;
|
||||||
///< Return name of the cell.
|
///< Return name of the cell.
|
||||||
///
|
///
|
||||||
/// \note If cell==0, the cell the player is currently in will be used instead to
|
/// \note If cell==0, the cell the player is currently in will be used instead to
|
||||||
/// generate a name.
|
/// generate a name.
|
||||||
std::string_view getCellName(const ESM::Cell* cell) const override;
|
const ESM::RefId getCellName(const ESM::Cell* cell) const override;
|
||||||
|
|
||||||
void removeRefScript(MWWorld::RefData* ref) override;
|
void removeRefScript(MWWorld::RefData* ref) override;
|
||||||
//< Remove the script attached to ref from mLocalScripts
|
//< Remove the script attached to ref from mLocalScripts
|
||||||
|
@ -344,7 +344,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void setSimulationTimeScale(float scale) override;
|
void setSimulationTimeScale(float scale) override;
|
||||||
|
|
||||||
void changeToInteriorCell(const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos,
|
void changeToInteriorCell(const ESM::RefId& cellName, const ESM::Position& position, bool adjustPlayerPos,
|
||||||
bool changeEvent = true) override;
|
bool changeEvent = true) override;
|
||||||
///< Move to interior cell.
|
///< Move to interior cell.
|
||||||
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
||||||
|
@ -358,7 +358,7 @@ namespace MWWorld
|
||||||
bool changeEvent = true) override;
|
bool changeEvent = true) override;
|
||||||
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
||||||
|
|
||||||
const ESM::Cell* getExterior(std::string_view cellName) const override;
|
const ESM::Cell* getExterior(const ESM::RefId& cellName) const override;
|
||||||
///< Return a cell matching the given name or a 0-pointer, if there is no such cell.
|
///< Return a cell matching the given name or a 0-pointer, if there is no such cell.
|
||||||
|
|
||||||
MWWorld::Ptr getFacedObject() override;
|
MWWorld::Ptr getFacedObject() override;
|
||||||
|
@ -609,11 +609,11 @@ namespace MWWorld
|
||||||
|
|
||||||
/// Find center of exterior cell above land surface
|
/// Find center of exterior cell above land surface
|
||||||
/// \return false if exterior with given name not exists, true otherwise
|
/// \return false if exterior with given name not exists, true otherwise
|
||||||
bool findExteriorPosition(std::string_view name, ESM::Position& pos) override;
|
bool findExteriorPosition(const ESM::RefId& name, ESM::Position& pos) override;
|
||||||
|
|
||||||
/// Find position in interior cell near door entrance
|
/// Find position in interior cell near door entrance
|
||||||
/// \return false if interior with given name not exists, true otherwise
|
/// \return false if interior with given name not exists, true otherwise
|
||||||
bool findInteriorPosition(std::string_view name, ESM::Position& pos) override;
|
bool findInteriorPosition(const ESM::RefId& name, ESM::Position& pos) override;
|
||||||
|
|
||||||
/// Enables or disables use of teleport spell effects (recall, intervention, etc).
|
/// Enables or disables use of teleport spell effects (recall, intervention, etc).
|
||||||
void enableTeleporting(bool enable) override;
|
void enableTeleporting(bool enable) override;
|
||||||
|
|
|
@ -62,11 +62,10 @@ MWWorld::CellStore* MWWorld::WorldModel::getCellStore(const ESM::Cell* cell)
|
||||||
{
|
{
|
||||||
if (cell->mData.mFlags & ESM::Cell::Interior)
|
if (cell->mData.mFlags & ESM::Cell::Interior)
|
||||||
{
|
{
|
||||||
std::string lowerName(Misc::StringUtils::lowerCase(cell->mName));
|
auto result = mInteriors.find(cell->mName);
|
||||||
auto result = mInteriors.find(lowerName);
|
|
||||||
|
|
||||||
if (result == mInteriors.end())
|
if (result == mInteriors.end())
|
||||||
result = mInteriors.emplace(std::move(lowerName), CellStore(cell, mStore, mReaders)).first;
|
result = mInteriors.emplace(std::move(cell->mName), CellStore(cell, mStore, mReaders)).first;
|
||||||
|
|
||||||
return &result->second;
|
return &result->second;
|
||||||
}
|
}
|
||||||
|
@ -170,16 +169,15 @@ MWWorld::CellStore* MWWorld::WorldModel::getExterior(int x, int y)
|
||||||
return &result->second;
|
return &result->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::CellStore* MWWorld::WorldModel::getInterior(std::string_view name)
|
MWWorld::CellStore* MWWorld::WorldModel::getInterior(const ESM::RefId& name)
|
||||||
{
|
{
|
||||||
std::string lowerName = Misc::StringUtils::lowerCase(name);
|
auto result = mInteriors.find(name);
|
||||||
auto result = mInteriors.find(lowerName);
|
|
||||||
|
|
||||||
if (result == mInteriors.end())
|
if (result == mInteriors.end())
|
||||||
{
|
{
|
||||||
const ESM::Cell* cell = mStore.get<ESM::Cell>().find(ESM::RefId::stringRefId(name));
|
const ESM::Cell* cell = mStore.get<ESM::Cell>().find(name);
|
||||||
|
|
||||||
result = mInteriors.emplace(lowerName, CellStore(cell, mStore, mReaders)).first;
|
result = mInteriors.emplace(name, CellStore(cell, mStore, mReaders)).first;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result->second.getState() != CellStore::State_Loaded)
|
if (result->second.getState() != CellStore::State_Loaded)
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace MWWorld
|
||||||
typedef std::vector<std::pair<ESM::RefId, CellStore*>> IdCache;
|
typedef std::vector<std::pair<ESM::RefId, CellStore*>> IdCache;
|
||||||
const MWWorld::ESMStore& mStore;
|
const MWWorld::ESMStore& mStore;
|
||||||
ESM::ReadersCache& mReaders;
|
ESM::ReadersCache& mReaders;
|
||||||
mutable std::map<std::string, CellStore> mInteriors;
|
mutable std::map<ESM::RefId, CellStore> mInteriors;
|
||||||
mutable std::map<std::pair<int, int>, CellStore> mExteriors;
|
mutable std::map<std::pair<int, int>, CellStore> mExteriors;
|
||||||
IdCache mIdCache;
|
IdCache mIdCache;
|
||||||
std::size_t mIdCacheIndex;
|
std::size_t mIdCacheIndex;
|
||||||
|
@ -55,7 +55,7 @@ namespace MWWorld
|
||||||
|
|
||||||
CellStore* getExterior(int x, int y);
|
CellStore* getExterior(int x, int y);
|
||||||
|
|
||||||
CellStore* getInterior(std::string_view name);
|
CellStore* getInterior(const ESM::RefId& name);
|
||||||
|
|
||||||
CellStore* getCell(const ESM::CellId& id);
|
CellStore* getCell(const ESM::CellId& id);
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ namespace ESM
|
||||||
{
|
{
|
||||||
struct Cell;
|
struct Cell;
|
||||||
struct Pathgrid;
|
struct Pathgrid;
|
||||||
|
struct RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Loading
|
namespace Loading
|
||||||
|
@ -91,6 +92,8 @@ namespace DetourNavigator
|
||||||
*/
|
*/
|
||||||
virtual void setWorldspace(std::string_view worldspace, const UpdateGuard* guard) = 0;
|
virtual void setWorldspace(std::string_view worldspace, const UpdateGuard* guard) = 0;
|
||||||
|
|
||||||
|
virtual void setWorldspace(const ESM::RefId& worldspace, const UpdateGuard* guard) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief updateBounds should be called before adding object from loading cell
|
* @brief updateBounds should be called before adding object from loading cell
|
||||||
* @param playerPosition corresponds to the bounds center
|
* @param playerPosition corresponds to the bounds center
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <components/esm3/loadpgrd.hpp>
|
#include <components/esm3/loadpgrd.hpp>
|
||||||
#include <components/misc/convert.hpp>
|
#include <components/misc/convert.hpp>
|
||||||
#include <components/misc/coordinateconverter.hpp>
|
#include <components/misc/coordinateconverter.hpp>
|
||||||
|
#include <components/misc/algorithm.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace DetourNavigator
|
namespace DetourNavigator
|
||||||
{
|
{
|
||||||
|
@ -37,6 +39,10 @@ namespace DetourNavigator
|
||||||
mNavMeshManager.setWorldspace(worldspace, getImpl(guard));
|
mNavMeshManager.setWorldspace(worldspace, getImpl(guard));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NavigatorImpl::setWorldspace(const ESM::RefId& worldspace, const UpdateGuard* guard) {
|
||||||
|
setWorldspace(Misc::StringUtils::lowerCase(worldspace.getRefIdString()), guard);
|
||||||
|
}
|
||||||
|
|
||||||
void NavigatorImpl::updateBounds(const osg::Vec3f& playerPosition, const UpdateGuard* guard)
|
void NavigatorImpl::updateBounds(const osg::Vec3f& playerPosition, const UpdateGuard* guard)
|
||||||
{
|
{
|
||||||
mNavMeshManager.updateBounds(playerPosition, getImpl(guard));
|
mNavMeshManager.updateBounds(playerPosition, getImpl(guard));
|
||||||
|
|
|
@ -29,6 +29,9 @@ namespace DetourNavigator
|
||||||
|
|
||||||
void setWorldspace(std::string_view worldspace, const UpdateGuard* guard) override;
|
void setWorldspace(std::string_view worldspace, const UpdateGuard* guard) override;
|
||||||
|
|
||||||
|
void setWorldspace(const ESM::RefId& worldspace, const UpdateGuard* guard) override;
|
||||||
|
|
||||||
|
|
||||||
void updateBounds(const osg::Vec3f& playerPosition, const UpdateGuard* guard) override;
|
void updateBounds(const osg::Vec3f& playerPosition, const UpdateGuard* guard) override;
|
||||||
|
|
||||||
void addObject(const ObjectId id, const ObjectShapes& shapes, const btTransform& transform,
|
void addObject(const ObjectId id, const ObjectShapes& shapes, const btTransform& transform,
|
||||||
|
|
|
@ -24,6 +24,8 @@ namespace DetourNavigator
|
||||||
void removeAgent(const AgentBounds& /*agentBounds*/) override {}
|
void removeAgent(const AgentBounds& /*agentBounds*/) override {}
|
||||||
|
|
||||||
void setWorldspace(std::string_view /*worldspace*/, const UpdateGuard* /*guard*/) override {}
|
void setWorldspace(std::string_view /*worldspace*/, const UpdateGuard* /*guard*/) override {}
|
||||||
|
void setWorldspace(const ESM::RefId& /*worldspace*/, const UpdateGuard* /*guard*/) override {}
|
||||||
|
|
||||||
|
|
||||||
void addObject(const ObjectId /*id*/, const ObjectShapes& /*shapes*/, const btTransform& /*transform*/,
|
void addObject(const ObjectId /*id*/, const ObjectShapes& /*shapes*/, const btTransform& /*transform*/,
|
||||||
const UpdateGuard* /*guard*/) override
|
const UpdateGuard* /*guard*/) override
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
|
|
||||||
const std::string CellId::sDefaultWorldspace = "sys::default";
|
const ESM::RefId CellId::sDefaultWorldspace = ESM::RefId::stringRefId("sys::default");
|
||||||
|
|
||||||
void CellId::load(ESMReader& esm)
|
void CellId::load(ESMReader& esm)
|
||||||
{
|
{
|
||||||
mWorldspace = esm.getHNString("SPAC");
|
mWorldspace = ESM::RefId::stringRefId(esm.getHNString("SPAC"));
|
||||||
|
|
||||||
if (esm.isNextSub("CIDX"))
|
if (esm.isNextSub("CIDX"))
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ namespace ESM
|
||||||
|
|
||||||
void CellId::save(ESMWriter& esm) const
|
void CellId::save(ESMWriter& esm) const
|
||||||
{
|
{
|
||||||
esm.writeHNString("SPAC", mWorldspace);
|
esm.writeHNString("SPAC", mWorldspace.getRefIdString());
|
||||||
|
|
||||||
if (mPaged)
|
if (mPaged)
|
||||||
esm.writeHNT("CIDX", mIndex, 8);
|
esm.writeHNT("CIDX", mIndex, 8);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define OPENMW_ESM_CELLID_H
|
#define OPENMW_ESM_CELLID_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <components/esm/refid.hpp>
|
||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
|
@ -16,11 +17,11 @@ namespace ESM
|
||||||
int mY;
|
int mY;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string mWorldspace;
|
ESM::RefId mWorldspace;
|
||||||
CellIndex mIndex;
|
CellIndex mIndex;
|
||||||
bool mPaged;
|
bool mPaged;
|
||||||
|
|
||||||
static const std::string sDefaultWorldspace;
|
static const ESM::RefId sDefaultWorldspace;
|
||||||
|
|
||||||
void load(ESMReader& esm);
|
void load(ESMReader& esm);
|
||||||
void save(ESMWriter& esm) const;
|
void save(ESMWriter& esm) const;
|
||||||
|
|
|
@ -109,7 +109,7 @@ namespace ESM
|
||||||
cellRef.mTeleport = true;
|
cellRef.mTeleport = true;
|
||||||
break;
|
break;
|
||||||
case fourCC("DNAM"):
|
case fourCC("DNAM"):
|
||||||
getHStringOrSkip(cellRef.mDestCell);
|
getRefIdOrSkip(cellRef.mDestCell);
|
||||||
break;
|
break;
|
||||||
case fourCC("FLTV"):
|
case fourCC("FLTV"):
|
||||||
getHTOrSkip(cellRef.mLockLevel);
|
getHTOrSkip(cellRef.mLockLevel);
|
||||||
|
@ -235,7 +235,7 @@ namespace ESM
|
||||||
if (!inInventory && mTeleport)
|
if (!inInventory && mTeleport)
|
||||||
{
|
{
|
||||||
esm.writeHNT("DODT", mDoorDest);
|
esm.writeHNT("DODT", mDoorDest);
|
||||||
esm.writeHNOCString("DNAM", mDestCell);
|
esm.writeHNOCString("DNAM", mDestCell.getRefIdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inInventory && mLockLevel != 0)
|
if (!inInventory && mLockLevel != 0)
|
||||||
|
@ -270,7 +270,7 @@ namespace ESM
|
||||||
mChargeIntRemainder = 0.0f;
|
mChargeIntRemainder = 0.0f;
|
||||||
mEnchantmentCharge = -1;
|
mEnchantmentCharge = -1;
|
||||||
mGoldValue = 1;
|
mGoldValue = 1;
|
||||||
mDestCell.clear();
|
mDestCell = ESM::RefId::sEmpty;
|
||||||
mLockLevel = 0;
|
mLockLevel = 0;
|
||||||
mKey = ESM::RefId::sEmpty;
|
mKey = ESM::RefId::sEmpty;
|
||||||
mTrap = ESM::RefId::sEmpty;
|
mTrap = ESM::RefId::sEmpty;
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace ESM
|
||||||
Position mDoorDest;
|
Position mDoorDest;
|
||||||
|
|
||||||
// Destination cell for doors (optional)
|
// Destination cell for doors (optional)
|
||||||
std::string mDestCell;
|
ESM::RefId mDestCell;
|
||||||
|
|
||||||
// Lock level for doors and containers
|
// Lock level for doors and containers
|
||||||
int mLockLevel;
|
int mLockLevel;
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace ESM
|
||||||
switch (esm.retSubName().toInt())
|
switch (esm.retSubName().toInt())
|
||||||
{
|
{
|
||||||
case SREC_NAME:
|
case SREC_NAME:
|
||||||
mName = esm.getHString();
|
mName = esm.getRefId();
|
||||||
break;
|
break;
|
||||||
case fourCC("DATA"):
|
case fourCC("DATA"):
|
||||||
esm.getHTSized<12>(mData);
|
esm.getHTSized<12>(mData);
|
||||||
|
@ -101,7 +101,7 @@ namespace ESM
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCellId.mWorldspace = Misc::StringUtils::lowerCase(mName);
|
mCellId.mWorldspace = mName;
|
||||||
mCellId.mIndex.mX = 0;
|
mCellId.mIndex.mX = 0;
|
||||||
mCellId.mIndex.mY = 0;
|
mCellId.mIndex.mY = 0;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ namespace ESM
|
||||||
|
|
||||||
void Cell::save(ESMWriter& esm, bool isDeleted) const
|
void Cell::save(ESMWriter& esm, bool isDeleted) const
|
||||||
{
|
{
|
||||||
esm.writeHNCString("NAME", mName);
|
esm.writeHNCString("NAME", mName.getRefIdString());
|
||||||
esm.writeHNT("DATA", mData, 12);
|
esm.writeHNT("DATA", mData, 12);
|
||||||
|
|
||||||
if (isDeleted)
|
if (isDeleted)
|
||||||
|
@ -225,12 +225,13 @@ namespace ESM
|
||||||
|
|
||||||
std::string Cell::getDescription() const
|
std::string Cell::getDescription() const
|
||||||
{
|
{
|
||||||
|
const auto& nameString = mName.getRefIdString();
|
||||||
if (mData.mFlags & Interior)
|
if (mData.mFlags & Interior)
|
||||||
return mName;
|
return nameString;
|
||||||
|
|
||||||
std::string cellGrid = "(" + std::to_string(mData.mX) + ", " + std::to_string(mData.mY) + ")";
|
std::string cellGrid = "(" + std::to_string(mData.mX) + ", " + std::to_string(mData.mY) + ")";
|
||||||
if (!mName.empty())
|
if (!mName.empty())
|
||||||
return mName + ' ' + cellGrid;
|
return nameString + ' ' + cellGrid;
|
||||||
// FIXME: should use sDefaultCellname GMST instead, but it's not available in this scope
|
// FIXME: should use sDefaultCellname GMST instead, but it's not available in this scope
|
||||||
std::string region = !mRegion.empty() ? mRegion.getRefIdString() : "Wilderness";
|
std::string region = !mRegion.empty() ? mRegion.getRefIdString() : "Wilderness";
|
||||||
|
|
||||||
|
@ -314,7 +315,7 @@ namespace ESM
|
||||||
|
|
||||||
void Cell::blank()
|
void Cell::blank()
|
||||||
{
|
{
|
||||||
mName.clear();
|
mName = ESM::RefId::sEmpty;
|
||||||
mRegion = ESM::RefId::sEmpty;
|
mRegion = ESM::RefId::sEmpty;
|
||||||
mWater = 0;
|
mWater = 0;
|
||||||
mWaterInt = false;
|
mWaterInt = false;
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace ESM
|
||||||
};
|
};
|
||||||
|
|
||||||
Cell()
|
Cell()
|
||||||
: mName("")
|
: mName(ESM::RefId::sEmpty)
|
||||||
, mRegion(ESM::RefId())
|
, mRegion(ESM::RefId())
|
||||||
, mHasAmbi(true)
|
, mHasAmbi(true)
|
||||||
, mWater(0)
|
, mWater(0)
|
||||||
|
@ -113,7 +113,7 @@ namespace ESM
|
||||||
|
|
||||||
// Interior cells are indexed by this (it's the 'id'), for exterior
|
// Interior cells are indexed by this (it's the 'id'), for exterior
|
||||||
// cells it is optional.
|
// cells it is optional.
|
||||||
std::string mName;
|
ESM::RefId mName;
|
||||||
|
|
||||||
// Optional region name for exterior and quasi-exterior cells.
|
// Optional region name for exterior and quasi-exterior cells.
|
||||||
RefId mRegion;
|
RefId mRegion;
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace EsmLoader
|
||||||
struct CellRecords
|
struct CellRecords
|
||||||
{
|
{
|
||||||
Records<ESM::Cell> mValues;
|
Records<ESM::Cell> mValues;
|
||||||
std::map<std::string, std::size_t> mByName;
|
std::map<ESM::RefId, std::size_t> mByName;
|
||||||
std::map<std::pair<int, int>, std::size_t> mByPosition;
|
std::map<std::pair<int, int>, std::size_t> mByPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,7 +101,6 @@ namespace EsmLoader
|
||||||
ESM::Cell record;
|
ESM::Cell record;
|
||||||
bool deleted = false;
|
bool deleted = false;
|
||||||
record.loadNameAndData(reader, deleted);
|
record.loadNameAndData(reader, deleted);
|
||||||
Misc::StringUtils::lowerCaseInPlace(record.mName);
|
|
||||||
|
|
||||||
if ((record.mData.mFlags & ESM::Cell::Interior) != 0)
|
if ((record.mData.mFlags & ESM::Cell::Interior) != 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue