Fix unit_placed event when [unit] recalls a units.
[unit] tries to recalls a unit when there is a unit with a matching id in the sides recall list. In this case the code would previously remove the unit from the recall list after firing the unit_placed event, (so the during the unit_placed event the unit was on the recall list and on the map at the same time breaking some wml codes, in particular #7769)
This commit is contained in:
parent
b86b6efd0e
commit
b50cf83f7e
1 changed files with 1 additions and 1 deletions
|
@ -203,9 +203,9 @@ void unit_creator::add_unit(const config &cfg, const vconfig* vcfg)
|
|||
if ( loc.valid() ) {
|
||||
board_->units().replace(loc, recall_list_element);
|
||||
LOG_NG << "inserting unit from recall list for side " << recall_list_element->side()<< " with id="<< id;
|
||||
post_create(loc,*(board_->units().find(loc)),animate,fire_event);
|
||||
//if id is not empty, delete units with this ID from recall list
|
||||
team_.recall_list().erase_if_matches_id( id);
|
||||
post_create(loc,*(board_->units().find(loc)),animate,fire_event);
|
||||
}
|
||||
else if ( add_to_recall_ ) {
|
||||
LOG_NG << "wanted to insert unit on recall list, but recall list for side " << (cfg)["side"] << "already contains id=" <<id;
|
||||
|
|
Loading…
Add table
Reference in a new issue