diff --git a/src/lib/nbt.cpp b/src/lib/nbt.cpp index 6a8a329..1c91f35 100644 --- a/src/lib/nbt.cpp +++ b/src/lib/nbt.cpp @@ -777,7 +777,7 @@ namespace NBT { return false; } - switch (data[0]) { + switch (data[currentPosition]) { case TagType::INT8: case TagType::INT16: case TagType::INT32: diff --git a/src/lib/nbt.hpp b/src/lib/nbt.hpp index b473112..b40d804 100644 --- a/src/lib/nbt.hpp +++ b/src/lib/nbt.hpp @@ -113,5 +113,5 @@ namespace NBT { bool validate(uint8_t data[]); }; - bool validateRawNBTData(uint8_t data[], uint64_t dataSize, uint64_t initialPosition, uint64_t* processedDataSize=nullptr); + bool validateRawNBTData(uint8_t data[], uint64_t dataSize, uint64_t initialPosition=0, uint64_t* processedDataSize=nullptr); }