small update_viewing_player refactor

gui_->show_everything() also depends on the blindfold
feature somehow, that's why the previous implementation
avoided using it and just disabled show_everything in
play_controllers constructor. However i now think
it's safe to use it here.
This commit is contained in:
gfgtdf 2023-05-06 19:11:03 +02:00
parent 9530ad1bc7
commit e9c9bb62d5
2 changed files with 1 additions and 5 deletions

View file

@ -282,10 +282,6 @@ void play_controller::init(const config& level)
gamestate().set_game_display(gui_.get());
gui2::dialogs::loading_screen::progress(loading_stage::init_lua);
// This is required to disable "show_everything"
if(get_teams().size() != 0) {
gui_->set_team(0);
}
init_managers();
gui2::dialogs::loading_screen::progress(loading_stage::start_game);
// loadscreen_manager->reset();

View file

@ -781,7 +781,7 @@ void playsingle_controller::update_viewing_player()
if(replay_controller_ && replay_controller_->is_controlling_view()) {
replay_controller_->update_viewing_player();
} else if(int side_num = play_controller::find_viewing_side()) {
if(side_num != gui_->viewing_side()) {
if(side_num != gui_->viewing_side() || gui_->show_everything()) {
update_gui_to_player(side_num - 1);
}
}