1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-17 19:49:10 +00:00

(svn r27328) -Codechange: Add an assertion to check for uninitialised variables when tracing variety distribution's control curves.

This commit is contained in:
frosch
2015-07-11 10:41:20 +00:00
parent 662408f71a
commit 8437726cca

View File

@@ -667,6 +667,7 @@ static void HeightMapCurves(uint level)
for (uint t = 0; t < lengthof(curve_maps); t++) {
if (!HasBit(corner_bits, t)) continue;
bool found = false;
const control_point_t *cm = curve_maps[t].list;
for (uint i = 0; i < curve_maps[t].length - 1; i++) {
const control_point_t &p1 = cm[i];
@@ -674,9 +675,11 @@ static void HeightMapCurves(uint level)
if (*h >= p1.x && *h < p2.x) {
ht[t] = p1.y + (*h - p1.x) * (p2.y - p1.y) / (p2.x - p1.x);
found = true;
break;
}
}
assert(found);
}
/* Apply interpolation of curve map results. */