summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/FireworksSerializer.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-02 17:28:51 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 13:48:59 +0100
commita2fb28dd082b85d714970f119a82cdba3583037a (patch)
tree7e680cbc89d22dc6d824370282bc4c8b26816ddd /src/WorldStorage/FireworksSerializer.cpp
parentDemonstrated issues with GetDataLength() (diff)
downloadcuberite-a2fb28dd082b85d714970f119a82cdba3583037a.tar
cuberite-a2fb28dd082b85d714970f119a82cdba3583037a.tar.gz
cuberite-a2fb28dd082b85d714970f119a82cdba3583037a.tar.bz2
cuberite-a2fb28dd082b85d714970f119a82cdba3583037a.tar.lz
cuberite-a2fb28dd082b85d714970f119a82cdba3583037a.tar.xz
cuberite-a2fb28dd082b85d714970f119a82cdba3583037a.tar.zst
cuberite-a2fb28dd082b85d714970f119a82cdba3583037a.zip
Diffstat (limited to 'src/WorldStorage/FireworksSerializer.cpp')
-rw-r--r--src/WorldStorage/FireworksSerializer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/WorldStorage/FireworksSerializer.cpp b/src/WorldStorage/FireworksSerializer.cpp
index 34204ae8a..464bf225d 100644
--- a/src/WorldStorage/FireworksSerializer.cpp
+++ b/src/WorldStorage/FireworksSerializer.cpp
@@ -89,7 +89,8 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB
if (ExplosionName == "Colors")
{
- int DataLength = a_NBT.GetDataLength(explosiontag);
+ // Divide by four as data length returned in bytes
+ int DataLength = a_NBT.GetDataLength(explosiontag) / 4;
if (DataLength == 0)
{
continue;
@@ -103,7 +104,7 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB
}
else if (ExplosionName == "FadeColors")
{
- int DataLength = a_NBT.GetDataLength(explosiontag);
+ int DataLength = a_NBT.GetDataLength(explosiontag) / 4;
if (DataLength == 0)
{
continue;