fix for Micrsoft compiler

This commit is contained in:
titiger 2017-02-20 00:39:09 +01:00
parent 5135d0fba3
commit 9acb64b1b3
1 changed files with 3 additions and 1 deletions

View File

@ -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) {