mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:59:57 +00:00
ESM::CellId is no longer stored on saves.
This commit is contained in:
parent
c39dd576f8
commit
fb6701ac1a
4 changed files with 12 additions and 6 deletions
|
@ -285,6 +285,7 @@ namespace
|
|||
ESM::MaxOldSkillsAndAttributesFormatVersion,
|
||||
ESM::MaxOldCreatureStatsFormatVersion,
|
||||
ESM::MaxStringRefIdFormatVersion,
|
||||
ESM::MaxUseEsmCellId,
|
||||
});
|
||||
for (ESM::FormatVersion v = result.back() + 1; v <= ESM::CurrentSaveGameFormatVersion; ++v)
|
||||
result.push_back(v);
|
||||
|
|
|
@ -89,9 +89,13 @@ namespace ESM
|
|||
|
||||
ESM::RefId ESMReader::getCellId()
|
||||
{
|
||||
ESM::CellId cellId;
|
||||
cellId.load(*this);
|
||||
return cellId.getCellRefId();
|
||||
if (mHeader.mFormatVersion <= ESM::MaxUseEsmCellId)
|
||||
{
|
||||
ESM::CellId cellId;
|
||||
cellId.load(*this);
|
||||
return cellId.getCellRefId();
|
||||
}
|
||||
return getHNRefId("NAME");
|
||||
}
|
||||
|
||||
void ESMReader::openRaw(std::unique_ptr<std::istream>&& stream, const std::filesystem::path& name)
|
||||
|
|
|
@ -239,8 +239,7 @@ namespace ESM
|
|||
|
||||
void ESMWriter::writeCellId(const ESM::RefId& cellId)
|
||||
{
|
||||
ESM::CellId cell = ESM::CellId::extractFromRefId(cellId);
|
||||
cell.save(*this);
|
||||
writeHNRefId("NAME", cellId);
|
||||
}
|
||||
|
||||
void ESMWriter::writeMaybeFixedSizeString(const std::string& data, std::size_t size)
|
||||
|
|
|
@ -23,7 +23,9 @@ namespace ESM
|
|||
inline constexpr FormatVersion MaxStringRefIdFormatVersion = 23;
|
||||
inline constexpr FormatVersion MaxSavedGameCellNameAsRefIdFormatVersion = 24;
|
||||
inline constexpr FormatVersion MaxNameIsRefIdOnlyFormatVersion = 25;
|
||||
inline constexpr FormatVersion CurrentSaveGameFormatVersion = 26;
|
||||
inline constexpr FormatVersion MaxUseEsmCellId = 26;
|
||||
inline constexpr FormatVersion CurrentSaveGameFormatVersion = 27;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue