Make it possible to use the "unit description" command in replay mode on fogged/shrouded units.

Fixes #3687
This commit is contained in:
josteph 2019-06-15 19:39:04 +00:00
parent 6befb68e46
commit bf8d5a14d0
3 changed files with 9 additions and 2 deletions

View file

@ -649,13 +649,14 @@ void menu_handler::rename_unit()
unit_map::iterator menu_handler::current_unit()
{
const mouse_handler& mousehandler = pc_.get_mouse_handler_base();
const bool see_all = pc_.is_replay() && dynamic_cast<playsingle_controller&>(pc_).get_replay_controller()->see_all();
unit_map::iterator res = board().find_visible_unit(mousehandler.get_last_hex(), teams()[gui_->viewing_team()]);
unit_map::iterator res = board().find_visible_unit(mousehandler.get_last_hex(), teams()[gui_->viewing_team()], see_all);
if(res != units().end()) {
return res;
}
return board().find_visible_unit(mousehandler.get_selected_hex(), teams()[gui_->viewing_team()]);
return board().find_visible_unit(mousehandler.get_selected_hex(), teams()[gui_->viewing_team()], see_all);
}
// Helpers for create_unit()

View file

@ -380,3 +380,8 @@ void replay_controller::update_viewing_player()
assert(vision_);
controller_.update_gui_to_player(vision_ == HUMAN_TEAM ? controller_.gamestate().first_human_team_ : controller_.current_side() - 1, *vision_ == SHOW_ALL);
}
bool replay_controller::see_all()
{
return vision_ == SHOW_ALL;
}

View file

@ -56,6 +56,7 @@ public:
void replay_show_team1();
void update_teams();
void update_viewing_player();
bool see_all();
private:
void add_replay_theme();
void init();