Skip to content

Commit

Permalink
Added check to ensure all map template units have a position less tha…
Browse files Browse the repository at this point in the history
…n the map template's size
  • Loading branch information
Andrettin committed Mar 13, 2022
1 parent 7344318 commit 281ee8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/map/map_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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> &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()
Expand Down

0 comments on commit 281ee8d

Please sign in to comment.