diff options
author | SmallJoker <mk939@ymail.com> | 2017-04-07 17:59:27 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2017-04-07 17:59:27 +0200 |
commit | c28a843592f8c88c6bb1cca830009d1affb3e9e0 (patch) | |
tree | 785871764d86c78397f99876179cdd32c17da261 /src | |
parent | 71ffe699d0d8e5cd2594eb74d0d767eeb8a09cea (diff) | |
download | minetest-c28a843592f8c88c6bb1cca830009d1affb3e9e0.tar.gz minetest-c28a843592f8c88c6bb1cca830009d1affb3e9e0.tar.bz2 minetest-c28a843592f8c88c6bb1cca830009d1affb3e9e0.zip |
Cavegen: Fix non-constant array initializer error for MSVC
Diffstat (limited to 'src')
-rw-r--r-- | src/cavegen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cavegen.cpp b/src/cavegen.cpp index 6275c516e..7993b20e7 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -199,7 +199,7 @@ bool CavernsNoise::generateCaverns(MMVManip *vm, v3s16 nmin, v3s16 nmax) noise_cavern->perlinMap3D(nmin.X, nmin.Y - 1, nmin.Z); // Cache cavern_amp values - float cavern_amp[m_csize.Y + 1]; + float *cavern_amp = new float[m_csize.Y + 1]; u8 cavern_amp_index = 0; // Index zero at column top for (s16 y = nmax.Y; y >= nmin.Y - 1; y--, cavern_amp_index++) { cavern_amp[cavern_amp_index] = @@ -241,6 +241,7 @@ bool CavernsNoise::generateCaverns(MMVManip *vm, v3s16 nmin, v3s16 nmax) } } + delete[] cavern_amp; return has_cavern; } |