08-28-2014, 09:21 PM
(08-28-2014, 09:05 PM)xoft Wrote: The asserts seem wrong, the comparison to Width should not include equality.Not for this one. (1 of 32 read/write overflow warnings)
Does VS give you any more information on this particular warning, such as the steps required to reproduce it?
But I think i know what the problem is.
ChunkDev.h line 78
Code:
typedef EMCSBiome BiomeMap[Width * Width];
Code:
inline static void SetBiome(BiomeMap & a_BiomeMap, int a_X, int a_Z, EMCSBiome a_Biome)
{
ASSERT((a_X >= 0) && (a_X <= Width));
ASSERT((a_Z >= 0) && (a_Z <= Width));
a_BiomeMap[a_X + Width * a_Z] = a_Biome;
}
a_X + Width * a_Z = 16 + 256 = 272
This would corret the warning:
Code:
inline static void SetBiome(BiomeMap & a_BiomeMap, int a_X, int a_Z, EMCSBiome a_Biome)
{
VERIFY((a_X >= 0) && (a_X <= Width));
VERIFY((a_Z >= 0) && (a_Z <= Width));
a_BiomeMap[(a_X * a_Z) - 1 ] = a_Biome;
}