1
0

Fixed off-by-one errors in cChunkDef asserts.

This commit is contained in:
madmaxoft 2014-09-01 21:17:22 +02:00
parent 3093f3d180
commit 6f18d01b51

View File

@ -197,32 +197,32 @@ public:
inline static int GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z) inline static int GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z)
{ {
ASSERT((a_X >= 0) && (a_X <= Width)); ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
return a_HeightMap[a_X + Width * a_Z]; return a_HeightMap[a_X + Width * a_Z];
} }
inline static void SetHeight(HeightMap & a_HeightMap, int a_X, int a_Z, unsigned char a_Height) inline static void SetHeight(HeightMap & a_HeightMap, int a_X, int a_Z, unsigned char a_Height)
{ {
ASSERT((a_X >= 0) && (a_X <= Width)); ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
a_HeightMap[a_X + Width * a_Z] = a_Height; a_HeightMap[a_X + Width * a_Z] = a_Height;
} }
inline static EMCSBiome GetBiome(const BiomeMap & a_BiomeMap, int a_X, int a_Z) inline static EMCSBiome GetBiome(const BiomeMap & a_BiomeMap, int a_X, int a_Z)
{ {
ASSERT((a_X >= 0) && (a_X <= Width)); ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
return a_BiomeMap[a_X + Width * a_Z]; return a_BiomeMap[a_X + Width * a_Z];
} }
inline static void SetBiome(BiomeMap & a_BiomeMap, int a_X, int a_Z, EMCSBiome a_Biome) 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_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
a_BiomeMap[a_X + Width * a_Z] = a_Biome; a_BiomeMap[a_X + Width * a_Z] = a_Biome;
} }