diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-03-10 19:13:07 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-03-10 19:13:07 +0100 |
commit | 8864e7d8ca63c972793234d3c65aa534fdec06ad (patch) | |
tree | 25c0ed2ece118d016be86b87787e6562ccf55dcf | |
parent | Removed unused macro (diff) | |
download | cuberite-8864e7d8ca63c972793234d3c65aa534fdec06ad.tar cuberite-8864e7d8ca63c972793234d3c65aa534fdec06ad.tar.gz cuberite-8864e7d8ca63c972793234d3c65aa534fdec06ad.tar.bz2 cuberite-8864e7d8ca63c972793234d3c65aa534fdec06ad.tar.lz cuberite-8864e7d8ca63c972793234d3c65aa534fdec06ad.tar.xz cuberite-8864e7d8ca63c972793234d3c65aa534fdec06ad.tar.zst cuberite-8864e7d8ca63c972793234d3c65aa534fdec06ad.zip |
-rw-r--r-- | src/WorldStorage/FireworksSerializer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/WorldStorage/FireworksSerializer.cpp b/src/WorldStorage/FireworksSerializer.cpp index 1f05b470d..bdd5952ad 100644 --- a/src/WorldStorage/FireworksSerializer.cpp +++ b/src/WorldStorage/FireworksSerializer.cpp @@ -90,16 +90,16 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB if (ExplosionName == "Colors") { // Divide by four as data length returned in bytes - int DataLength = a_NBT.GetDataLength(explosiontag) / 4; + int DataLength = a_NBT.GetDataLength(explosiontag); if (DataLength == 0) { continue; } - const int * ColourData = (const int *)(a_NBT.GetData(explosiontag)); - for (int i = 0; i < DataLength; i++) + const char * ColourData = (a_NBT.GetData(explosiontag)); + for (int i = 0; i < DataLength; i += 4 /* Size of network int*/) { - a_FireworkItem.m_Colours.push_back(ntohl(ColourData[i])); + a_FireworkItem.m_Colours.push_back(GetBEInt(ColourData + i)); } } else if (ExplosionName == "FadeColors") @@ -110,10 +110,10 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB continue; } - const int * FadeColourData = (const int *)(a_NBT.GetData(explosiontag)); - for (int i = 0; i < DataLength; i++) + const char * FadeColourData = (a_NBT.GetData(explosiontag)); + for (int i = 0; i < DataLength; i += 4 /* Size of network int*/) { - a_FireworkItem.m_FadeColours.push_back(ntohl(FadeColourData[i])); + a_FireworkItem.m_FadeColours.push_back(GetBEInt(FadeColourData + i)); } } } |