Fix early crash if no teams are defined
gui_->viewing_team() in refresh_objectives results in invalid index access if there are no teams here.
This commit is contained in:
parent
93cfddaa27
commit
d37679a7c9
1 changed files with 5 additions and 3 deletions
|
@ -363,9 +363,11 @@ void play_controller::fire_prestart()
|
|||
|
||||
void play_controller::refresh_objectives() const
|
||||
{
|
||||
const config cfg("side", gui_->viewing_team().side());
|
||||
gamestate().lua_kernel_->run_wml_action("show_objectives", vconfig(cfg),
|
||||
game_events::queued_event("_from_interface", "", map_location(), map_location(), config()));
|
||||
if(!get_teams().empty()) {
|
||||
const config cfg("side", gui_->viewing_team().side());
|
||||
gamestate().lua_kernel_->run_wml_action("show_objectives", vconfig(cfg),
|
||||
game_events::queued_event("_from_interface", "", map_location(), map_location(), config()));
|
||||
}
|
||||
}
|
||||
|
||||
void play_controller::fire_start()
|
||||
|
|
Loading…
Add table
Reference in a new issue