summaryrefslogtreecommitdiffstats
path: root/src/Noise.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-02 19:34:28 +0200
committermadmaxoft <github@xoft.cz>2014-05-02 19:34:28 +0200
commit839447f0bbdf97eb9b3c07f943647fa9c92b1e5b (patch)
tree3cde3e248dc73e19f3b241245fdff612842f9632 /src/Noise.cpp
parentA tiny speed improvement in ApplyFoodExhaustion() (diff)
parentFixed MagmaCube spawning. (diff)
downloadcuberite-839447f0bbdf97eb9b3c07f943647fa9c92b1e5b.tar
cuberite-839447f0bbdf97eb9b3c07f943647fa9c92b1e5b.tar.gz
cuberite-839447f0bbdf97eb9b3c07f943647fa9c92b1e5b.tar.bz2
cuberite-839447f0bbdf97eb9b3c07f943647fa9c92b1e5b.tar.lz
cuberite-839447f0bbdf97eb9b3c07f943647fa9c92b1e5b.tar.xz
cuberite-839447f0bbdf97eb9b3c07f943647fa9c92b1e5b.tar.zst
cuberite-839447f0bbdf97eb9b3c07f943647fa9c92b1e5b.zip
Diffstat (limited to 'src/Noise.cpp')
-rw-r--r--src/Noise.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Noise.cpp b/src/Noise.cpp
index efbb128c3..13a194938 100644
--- a/src/Noise.cpp
+++ b/src/Noise.cpp
@@ -608,6 +608,8 @@ void cCubicNoise::Generate2D(
NOISE_DATATYPE a_StartY, NOISE_DATATYPE a_EndY ///< Noise-space coords of the array in the Y direction
) const
{
+ ASSERT(a_SizeX > 0);
+ ASSERT(a_SizeY > 0);
ASSERT(a_SizeX < MAX_SIZE);
ASSERT(a_SizeY < MAX_SIZE);
ASSERT(a_StartX < a_EndX);
@@ -744,6 +746,8 @@ void cCubicNoise::CalcFloorFrac(
int * a_Same, int & a_NumSame
) const
{
+ ASSERT(a_Size > 0);
+
NOISE_DATATYPE val = a_Start;
NOISE_DATATYPE dif = (a_End - a_Start) / (a_Size - 1);
for (int i = 0; i < a_Size; i++)