1
0

More valgrind uninitialized var fixing

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1040 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft 2012-11-13 15:58:27 +00:00
parent 1b75e74a9e
commit 76ab9fc0a8

View File

@ -66,6 +66,13 @@ public:
{ {
m_Writer.EndList(); m_Writer.EndList();
} }
// If light not valid, reset it to all zeroes:
if (!m_IsLightValid)
{
memset(m_BlockLight, 0, sizeof(m_BlockLight));
memset(m_BlockSkyLight, 0, sizeof(m_BlockSkyLight));
}
} }
@ -593,8 +600,11 @@ bool cWSSAnvil::SaveChunkToNBT(const cChunkCoords & a_Chunk, cFastNBTWriter & a_
Serializer.Finish(); // Close NBT tags Serializer.Finish(); // Close NBT tags
// Save biomes, both MCS (IntArray) and MC-vanilla (ByteArray): // Save biomes, both MCS (IntArray) and MC-vanilla (ByteArray):
a_Writer.AddByteArray("Biomes", (const char *)(Serializer.m_VanillaBiomes), ARRAYCOUNT(Serializer.m_VanillaBiomes)); if (Serializer.m_BiomesAreValid)
a_Writer.AddIntArray ("MCSBiomes", (const int *)(Serializer.m_Biomes), ARRAYCOUNT(Serializer.m_Biomes)); {
a_Writer.AddByteArray("Biomes", (const char *)(Serializer.m_VanillaBiomes), ARRAYCOUNT(Serializer.m_VanillaBiomes));
a_Writer.AddIntArray ("MCSBiomes", (const int *)(Serializer.m_Biomes), ARRAYCOUNT(Serializer.m_Biomes));
}
// Save blockdata: // Save blockdata:
a_Writer.BeginList("Sections", TAG_Compound); a_Writer.BeginList("Sections", TAG_Compound);