diff options
author | Mattes D <github@xoft.cz> | 2014-12-07 15:01:36 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-12-07 15:01:36 +0100 |
commit | d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21 (patch) | |
tree | b0dbd8a8396ad22cf77cb4b367295d25ad3055a7 /src/WorldStorage | |
parent | Reduced river height (diff) | |
parent | Merge remote-tracking branch 'origin/master' into c++11 (diff) | |
download | cuberite-d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21.tar cuberite-d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21.tar.gz cuberite-d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21.tar.bz2 cuberite-d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21.tar.lz cuberite-d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21.tar.xz cuberite-d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21.tar.zst cuberite-d00ebd7ee700fcd7f30ea27d238ba1f0d56dfe21.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/FireworksSerializer.cpp | 8 | ||||
-rw-r--r-- | src/WorldStorage/MapSerializer.cpp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/WorldStorage/FireworksSerializer.cpp b/src/WorldStorage/FireworksSerializer.cpp index ecb600483..91a5b8b63 100644 --- a/src/WorldStorage/FireworksSerializer.cpp +++ b/src/WorldStorage/FireworksSerializer.cpp @@ -22,11 +22,11 @@ void cFireworkItem::WriteToNBTCompound(const cFireworkItem & a_FireworkItem, cFa a_Writer.AddByte("Type", a_FireworkItem.m_Type); if (!a_FireworkItem.m_Colours.empty()) { - a_Writer.AddIntArray("Colors", &(a_FireworkItem.m_Colours[0]), a_FireworkItem.m_Colours.size()); + a_Writer.AddIntArray("Colors", a_FireworkItem.m_Colours.data(), a_FireworkItem.m_Colours.size()); } if (!a_FireworkItem.m_FadeColours.empty()) { - a_Writer.AddIntArray("FadeColors", &(a_FireworkItem.m_FadeColours[0]), a_FireworkItem.m_FadeColours.size()); + a_Writer.AddIntArray("FadeColors", a_FireworkItem.m_FadeColours.data(), a_FireworkItem.m_FadeColours.size()); } a_Writer.EndCompound(); a_Writer.EndList(); @@ -41,11 +41,11 @@ void cFireworkItem::WriteToNBTCompound(const cFireworkItem & a_FireworkItem, cFa a_Writer.AddByte("Type", a_FireworkItem.m_Type); if (!a_FireworkItem.m_Colours.empty()) { - a_Writer.AddIntArray("Colors", &(a_FireworkItem.m_Colours[0]), a_FireworkItem.m_Colours.size()); + a_Writer.AddIntArray("Colors", a_FireworkItem.m_Colours.data(), a_FireworkItem.m_Colours.size()); } if (!a_FireworkItem.m_FadeColours.empty()) { - a_Writer.AddIntArray("FadeColors", &(a_FireworkItem.m_FadeColours[0]), a_FireworkItem.m_FadeColours.size()); + a_Writer.AddIntArray("FadeColors", a_FireworkItem.m_FadeColours.data(), a_FireworkItem.m_FadeColours.size()); } a_Writer.EndCompound(); break; diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp index 4a913c81a..f2d35b318 100644 --- a/src/WorldStorage/MapSerializer.cpp +++ b/src/WorldStorage/MapSerializer.cpp @@ -112,7 +112,7 @@ void cMapSerializer::SaveMapToNBT(cFastNBTWriter & a_Writer) a_Writer.AddInt("zCenter", m_Map->GetCenterZ()); const cMap::cColorList & Data = m_Map->GetData(); - a_Writer.AddByteArray("colors", (char *) &Data[0], Data.size()); + a_Writer.AddByteArray("colors", (char *)Data.data(), Data.size()); a_Writer.EndCompound(); } @@ -190,7 +190,7 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT) CurrLine = a_NBT.FindChildByName(Data, "colors"); if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_ByteArray)) { - memcpy(&m_Map->m_Data[0], a_NBT.GetData(CurrLine), NumPixels); + memcpy(m_Map->m_Data.data(), a_NBT.GetData(CurrLine), NumPixels); } return true; |