wb: add a assertion

This commit is contained in:
gfgtdf 2018-05-12 12:11:58 +02:00
parent 5884aa27ea
commit 6a9e2c260d

View file

@ -143,7 +143,11 @@ void recruit::apply_temp_modifier(unit_map& unit_map)
// Temporarily insert unit into unit_map
// unit map takes ownership of temp_unit
const size_t old_id = temp_unit_->underlying_id();
unit_map.insert(temp_unit_);
//in the past there was a bug where the map changed the unit ids here (because a unit with that id already existed) which caused crashes later.
assert(temp_unit_->underlying_id() == old_id);
}
void recruit::remove_temp_modifier(unit_map& unit_map)