wb: add a assertion
This commit is contained in:
parent
5884aa27ea
commit
6a9e2c260d
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue