Don't scroll to an enemy leader that has an effective [hides] ability (#3492)
This commit is contained in:
parent
5f7b1853dd
commit
24cb784d4b
3 changed files with 4 additions and 3 deletions
|
@ -188,7 +188,7 @@ void game_display::scroll_to_leader(int side, SCROLL_TYPE scroll_type, bool forc
|
|||
{
|
||||
unit_map::const_iterator leader = dc_->units().find_leader(side);
|
||||
|
||||
if(leader.valid()) {
|
||||
if(leader.valid() && leader->is_visible_to_team(dc_->get_team(viewing_side()), *dc_, false)) {
|
||||
scroll_to_tile(leader->get_location(), scroll_type, true, force);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -593,7 +593,8 @@ bool menu_handler::end_turn(int side_num)
|
|||
void menu_handler::goto_leader(int side_num)
|
||||
{
|
||||
unit_map::const_iterator i = units().find_leader(side_num);
|
||||
if(i != units().end()) {
|
||||
const display_context& dc = gui_->get_disp_context();
|
||||
if(i != units().end() && i->is_visible_to_team(dc.get_team(gui_->viewing_side()), dc, false)) {
|
||||
gui_->scroll_to_tile(i->get_location(), game_display::WARP);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -925,7 +925,7 @@ private:
|
|||
/**
|
||||
* @}
|
||||
* @defgroup unit_trait Trait and upkeep functions
|
||||
* @}
|
||||
* @{
|
||||
*/
|
||||
public:
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue