Sheet Ore: Eliminate crash caused by PcgRandom range max < min
authorparamat <mat.gregory@virginmedia.com>
Sun, 21 Feb 2016 13:28:34 +0000 (13:28 +0000)
committerparamat <mat.gregory@virginmedia.com>
Tue, 23 Feb 2016 23:51:29 +0000 (23:51 +0000)
commit8591713405419c434801c61ca59a9b6c019eb957
tree48434b5d10f72ec8309e65fae1c32aae231daf5f
parent147425483a9e1afa2a2a4d9c0d5fa8b68d105644
Sheet Ore: Eliminate crash caused by PcgRandom range max < min

In the calculation of y_start,
when 'column height max' was large it caused
nmin.Y + max_height > nmax.Y - max_height
Now, in this situation y_start is set to the
midpoint between nmin.Y and nmax.Y

Limit y0 and y1 to between nmin.Y and nmax.Y,
otherwise index calculation, which has no checks for limits,
places them at unwanted locations in the voxelmanip
src/mg_ore.cpp