From 281ee8d89f7786889d241de437cb00b268c6a965 Mon Sep 17 00:00:00 2001 From: Andrettin <6322423+Andrettin@users.noreply.github.com> Date: Sun, 13 Mar 2022 20:52:08 +0100 Subject: [PATCH] Added check to ensure all map template units have a position less than the map template's size --- src/map/map_template.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map/map_template.cpp b/src/map/map_template.cpp index d32a3d1ac..06aeb6c27 100644 --- a/src/map/map_template.cpp +++ b/src/map/map_template.cpp @@ -547,6 +547,11 @@ void map_template::check() const throw std::runtime_error("Map template \"" + this->get_identifier() + "\" has \"" + this->get_default_astrocoordinate_reference_subtemplate()->get_identifier() + "\" as its default astrocoordinate reference subtemplate, but the latter is not a subtemplate of the former, even indirectly."); } */ + + for (const std::unique_ptr &map_template_unit : this->units) { + assert_throw(map_template_unit->get_pos().x() < this->get_size().width()); + assert_throw(map_template_unit->get_pos().y() < this->get_size().height()); + } } data_entry_history *map_template::get_history_base()