Fix a bug spotted by Mordante:
undo a recruit/recall cause glitches if the unit is on a hex with height offset. (one can argue that we must invalidate all the adjacent hexes, but this method is simpler and more efficient)
This commit is contained in:
parent
7690015f96
commit
e15cb7926b
1 changed files with 6 additions and 2 deletions
|
@ -1001,8 +1001,10 @@ namespace events{
|
|||
|
||||
std::vector<unit>& recall_list = player->available_units;
|
||||
recall_list.insert(recall_list.begin()+action.recall_pos,un);
|
||||
units_.erase(action.recall_loc);
|
||||
// invalidate before erasing allow us
|
||||
// to also do the ovelerlapped hexes
|
||||
gui_->invalidate(action.recall_loc);
|
||||
units_.erase(action.recall_loc);
|
||||
gui_->draw();
|
||||
}
|
||||
} else if(action.is_recruit()) {
|
||||
|
@ -1023,8 +1025,10 @@ namespace events{
|
|||
teams_[team_num-1].set_action_bonus_count(teams_[team_num-1].action_bonus_count() - 1);
|
||||
}
|
||||
|
||||
units_.erase(action.recall_loc);
|
||||
// invalidate before erasing allow us
|
||||
// to also do the ovelerlapped hexes
|
||||
gui_->invalidate(action.recall_loc);
|
||||
units_.erase(action.recall_loc);
|
||||
gui_->draw();
|
||||
} else {
|
||||
// Undo a move action
|
||||
|
|
Loading…
Add table
Reference in a new issue