summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/FireworksSerializer.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-03-10 21:18:53 +0100
committerTycho <work.tycho+git@gmail.com>2014-03-10 21:18:53 +0100
commit98e15a34a416c31d4689836f4f38161f1270513c (patch)
tree1ae50f2ff4748ac22c810f1f631002b223e02c62 /src/WorldStorage/FireworksSerializer.cpp
parentFixed test asserts (diff)
downloadcuberite-98e15a34a416c31d4689836f4f38161f1270513c.tar
cuberite-98e15a34a416c31d4689836f4f38161f1270513c.tar.gz
cuberite-98e15a34a416c31d4689836f4f38161f1270513c.tar.bz2
cuberite-98e15a34a416c31d4689836f4f38161f1270513c.tar.lz
cuberite-98e15a34a416c31d4689836f4f38161f1270513c.tar.xz
cuberite-98e15a34a416c31d4689836f4f38161f1270513c.tar.zst
cuberite-98e15a34a416c31d4689836f4f38161f1270513c.zip
Diffstat (limited to 'src/WorldStorage/FireworksSerializer.cpp')
-rw-r--r--src/WorldStorage/FireworksSerializer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/WorldStorage/FireworksSerializer.cpp b/src/WorldStorage/FireworksSerializer.cpp
index bdd5952ad..3c97ae0a2 100644
--- a/src/WorldStorage/FireworksSerializer.cpp
+++ b/src/WorldStorage/FireworksSerializer.cpp
@@ -91,6 +91,8 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB
{
// Divide by four as data length returned in bytes
int DataLength = a_NBT.GetDataLength(explosiontag);
+ // round to the next highest multiple of four
+ DataLength -= DataLength % 4;
if (DataLength == 0)
{
continue;
@@ -105,6 +107,8 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB
else if (ExplosionName == "FadeColors")
{
int DataLength = a_NBT.GetDataLength(explosiontag) / 4;
+ // round to the next highest multiple of four
+ DataLength -= DataLength % 4;
if (DataLength == 0)
{
continue;