From e8252152cfff5fad65fa0ba8f857d85dc9c7dbf6 Mon Sep 17 00:00:00 2001 From: Смердокрыл Date: Sun, 26 Oct 2025 20:08:52 +0200 Subject: Tools/map_extractor: Fix segfault with CONF_allow_float_to_int=false (#31353) --- src/tools/map_extractor/System.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index b0fbed1960d..e50eb89bf86 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -891,7 +891,7 @@ bool ConvertADT(ChunkedFile& adt, std::string const& mapName, std::string const& } else { - int minX = 255, minY = 255; + int minX = ADT_GRID_SIZE, minY = ADT_GRID_SIZE; int maxX = 0, maxY = 0; maxHeight = -20000; minHeight = 20000; @@ -927,6 +927,9 @@ bool ConvertADT(ChunkedFile& adt, std::string const& mapName, std::string const& liquidHeader.height = maxY - minY + 1 + 1; liquidHeader.liquidLevel = minHeight; + if (minY > maxY || minX > maxX) + liquidHeader.flags |= map_liquidHeaderFlags::NoHeight; + if (maxHeight == minHeight) liquidHeader.flags |= map_liquidHeaderFlags::NoHeight; -- cgit v1.2.3