diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tgp.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp index 8177b5720..cf597ea87 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -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. */ |