From 1274a3fae400318732ba0c17964d2d3bc31a612d Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sat, 16 Mar 2019 20:08:57 +0000 Subject: [PATCH] Fix #8885. Incorrect function for calculating lowest water height. Looks like a good old ctrl+c, ctrl+v and then forgot to actually modify it correctly. --- src/openrct2/actions/WaterRaiseAction.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/openrct2/actions/WaterRaiseAction.hpp b/src/openrct2/actions/WaterRaiseAction.hpp index 65b4104859..d95fefd359 100644 --- a/src/openrct2/actions/WaterRaiseAction.hpp +++ b/src/openrct2/actions/WaterRaiseAction.hpp @@ -136,14 +136,15 @@ private: if (tile_element == nullptr) continue; - uint8_t height = tile_element->AsSurface()->GetWaterHeight(); - if (height != 0) + uint8_t height = tile_element->base_height; + if (tile_element->AsSurface()->GetWaterHeight() > 0) { - height *= 2; - if (maxHeight > height) - { - maxHeight = height; - } + height = tile_element->AsSurface()->GetWaterHeight() * 2; + } + + if (maxHeight > height) + { + maxHeight = height; } } }