Skip to content

Commit

Permalink
Load nested DATA in ConfigReader
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyuu17 committed Jul 4, 2024
1 parent 5a5f42a commit 679a741
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/SWBF2/Native/Chunks/ConfigReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@ namespace SWBF2::Native
*dataReaderChild >> node.m_string;
}

auto scopReaderChild = streamReader.ReadChildWithHeader<"SCOP"_m>();
if (streamReader.IsNextHeader<"SCOP"_m>())
{
auto scopReaderChild = streamReader.ReadChildWithHeader<"SCOP"_m>();
ReadDataScop(*scopReaderChild, node);
}
else if (streamReader.IsNextHeader<"DATA"_m>())
{
ReadDataScop(streamReader, node);
}
else
{
throw std::runtime_error{ "unexpected header" };
}
}
}

Expand Down

0 comments on commit 679a741

Please sign in to comment.