World: ChunkData: make getRoot() return shared pointer reference

This commit is contained in:
Matthias Schiffer 2021-12-03 23:54:15 +01:00
parent 16a1258f08
commit 21966252ea
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@ namespace World {
Chunk::Chunk(const ChunkData *data) {
std::shared_ptr<const NBT::CompoundTag> level =
assertValue(data->getRoot().get<NBT::CompoundTag>("Level"));
assertValue(data->getRoot()->get<NBT::CompoundTag>("Level"));
std::shared_ptr<const NBT::ListTag> sectionsTag = level->get<NBT::ListTag>("Sections");
if (!sectionsTag || sectionsTag->empty())
@ -37,7 +37,7 @@ Chunk::Chunk(const ChunkData *data) {
else
throw std::invalid_argument("corrupt biome data");
auto dataVersionTag = data->getRoot().get<NBT::IntTag>("DataVersion");
auto dataVersionTag = data->getRoot()->get<NBT::IntTag>("DataVersion");
uint32_t dataVersion = dataVersionTag ? dataVersionTag->getValue() : 0;
for (auto &sTag : *sectionsTag) {