MegaGlest / megaglest-source

MegaGlest real-time strategy game engine (cross-platform, 3-d)
http://megaglest.org/
348 stars 89 forks source link

map editor - if a map is unequal dimensions, randomize heights function causes editor to crash #147

Closed andy5995 closed 7 years ago

andy5995 commented 7 years ago

Using the latest version of git on Debian stretch/testing

When I tried to randomize the height on a 128x64 map (after I hit ok on the randomize dialog), the editor crashed abruptly.

Related issue: When I tried to randomize the height on a 64x128 map, the editor did not crash, but the bottom half randomized in a "weird" way.

issue_rnd_mapeditor_01.zip

The issues above reproduce every time.

I get this warning when starting the editor

Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1009,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1010,wx containers,compatible with 2.8).

I don't know why. My version of git is a self-build.

andy5995 commented 7 years ago

On L1034 of map_preview.cpp I see the code that's likely responsible for this.

I don't see the problem yet. I'll study it some more.

A correction to the first post: after randomize height is done on 64 x 128 map, the lower half becomes all water.

andy5995 commented 7 years ago

Looks like the realRandomize function is ok. The problem is when it calls smoothSurface(), I think on L733.

andy5995 commented 7 years ago

tested, works for me. Thanks.