From 9acb64b1b33feef9dd6b07994c38c9ffd213ae51 Mon Sep 17 00:00:00 2001 From: titiger Date: Mon, 20 Feb 2017 00:39:09 +0100 Subject: [PATCH] fix for Micrsoft compiler --- source/shared_lib/sources/map/map_preview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/map/map_preview.cpp b/source/shared_lib/sources/map/map_preview.cpp index 14ada7722..d70660370 100644 --- a/source/shared_lib/sources/map/map_preview.cpp +++ b/source/shared_lib/sources/map/map_preview.cpp @@ -726,7 +726,8 @@ void MapPreview::randomizeFactions() { } void MapPreview::smoothSurface(bool limitHeight) { - float oldHeights [w*h]; + //float oldHeights [w*h]; + float *oldHeights = new float[w*h]; // dumb microsoft compiler cannot handle dynamic arrays, doing it manually for (int j = 0; j < h; ++j) { for (int i = 0; i < w; ++i) { oldHeights[w*j+i] = cells[i][j].height; @@ -755,6 +756,7 @@ void MapPreview::smoothSurface(bool limitHeight) { cells[i][j].height=height; } } + delete[] oldHeights; } void MapPreview::switchSurfaces(MapSurfaceType surf1, MapSurfaceType surf2) {