diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index f6d819d612..e1f4cf174e 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -368,7 +368,7 @@ public: case WID_RV_START_REPLACE: { Dimension d = GetStringBoundingBox(STR_REPLACE_VEHICLES_START); - maxdim(d, GetStringListBoundingBox(_start_replace_dropdown)); + d = maxdim(d, GetStringListBoundingBox(_start_replace_dropdown)); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/core/geometry_func.hpp b/src/core/geometry_func.hpp index 175a8a2ba7..58ebd316ab 100644 --- a/src/core/geometry_func.hpp +++ b/src/core/geometry_func.hpp @@ -12,7 +12,7 @@ #include "geometry_type.hpp" -Dimension maxdim(const Dimension &d1, const Dimension &d2); +[[nodiscard]] Dimension maxdim(const Dimension &d1, const Dimension &d2); /** * Check if a rectangle is empty. diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index cd203da979..827223e932 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -660,7 +660,7 @@ struct GenerateLandscapeWindow : public Window { default: return; } - maxdim(d, GetStringListBoundingBox(strs)); + d = maxdim(d, GetStringListBoundingBox(strs)); d.width += padding.width; d.height += padding.height; size = maxdim(size, d);