tools/dumpnbt: Display empty lists correctly

Soda
BodgeMaster 2022-10-17 07:02:36 +02:00
parent 92cf81c1b4
commit c14504ce0b
1 changed files with 6 additions and 2 deletions

View File

@ -203,8 +203,12 @@ void drawTree(NBT::Tag::Generic* tag, tiny_utf8::string prefix, uint64_t offsetB
}
std::cout << std::endl;
std::cout << prefix << "|Length: " << list->length() << std::endl;
std::cout << prefix << "|" << std::endl;
if (list->length() > 0) {
std::cout << prefix << "|Length: " << list->length() << std::endl;
std::cout << prefix << "|" << std::endl;
} else {
std::cout << prefix << "'Length: " << list->length() << std::endl;
}
offsetBytes = offsetBytes + headerSize + 5;
for (uint64_t i=0; i<list->length(); i++) {