Fix layerNameOffsets being incorrect

This commit is contained in:
Phillip Stephens 2021-05-29 15:17:14 -07:00
parent c5ddf8c540
commit 324a613601
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
} }
size_t areaIdx = 0; size_t areaIdx = 0;
size_t nameOffset = 0; size_t nameStartIdx = 0;
for (const World::Area& area : wld.areas) { for (const World::Area& area : wld.areas) {
if (area.path.getPathType() != hecl::ProjectPath::Type::Directory) if (area.path.getPathType() != hecl::ProjectPath::Type::Directory)
continue; continue;
@ -258,7 +258,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
mlvl.layerFlags.back().flags = ~0; mlvl.layerFlags.back().flags = ~0;
/* Layer name offset */ /* Layer name offset */
mlvl.layerNameOffsets.push_back(nameOffset); mlvl.layerNameOffsets.push_back(nameStartIdx);
areaInit = true; areaInit = true;
} }
@ -300,7 +300,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
hecl::SystemUTF8Conv layerU8(layerName); hecl::SystemUTF8Conv layerU8(layerName);
mlvl.layerNames.emplace_back(layerU8.str()); mlvl.layerNames.emplace_back(layerU8.str());
nameOffset += layerName.size() + 1; ++nameStartIdx;
MLVL::LayerFlags& thisLayFlags = mlvl.layerFlags.back(); MLVL::LayerFlags& thisLayFlags = mlvl.layerFlags.back();
++thisLayFlags.layerCount; ++thisLayFlags.layerCount;