summaryrefslogtreecommitdiff
path: root/src/tgp.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-01 11:16:19 +0200
committerGitHub <noreply@github.com>2021-04-01 11:16:19 +0200
commitfece1c57cab1d148e15775f3e10ba474dcfc1360 (patch)
tree864829048f995a13c2ada0a6f731404a7de0bab7 /src/tgp.cpp
parent9eb6c78a0245317f8dc68ad1034b66019e1bf14f (diff)
downloadopenttd-fece1c57cab1d148e15775f3e10ba474dcfc1360.tar.xz
Codechange: Suppress warnings when asserts are disabled (#8917)
Diffstat (limited to 'src/tgp.cpp')
-rw-r--r--src/tgp.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp
index d86617ee2..39fda6e6b 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -658,7 +658,9 @@ static void HeightMapCurves(uint level)
for (uint t = 0; t < lengthof(curve_maps); t++) {
if (!HasBit(corner_bits, t)) continue;
+#ifndef NDEBUG
bool found = false;
+#endif
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];
@@ -666,7 +668,9 @@ 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);
+#ifndef NDEBUG
found = true;
+#endif
break;
}
}