Skip to content

Commit

Permalink
fix play_controller::is_browsing()
Browse files Browse the repository at this point in the history
we now check linger_, init_side_done_ and gamestate_.gamedata_.phase() before accessing current_team().
This is saver since during linger mode or during initilisation there is not really a 'current team'.
  • Loading branch information
gfgtdf committed Mar 8, 2015
1 parent 4da8eec commit b9bed4f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/play_controller.cpp
Expand Up @@ -985,12 +985,11 @@ hotkey::command_executor * play_controller::get_hotkey_command_executor() {

bool play_controller::is_browsing() const
{
if(linger_ || !init_side_done_ || this->gamestate_.gamedata_.phase() != game_data::PLAY) {
return false;
}
const team& t = current_team();
return !t.is_local_human()
|| !t.is_proxy_human()
|| linger_
|| !init_side_done_
|| this->gamestate_.gamedata_.phase() != game_data::PLAY;
return !t.is_local_human() || !t.is_proxy_human();
}

void play_controller::play_slice_catch()
Expand Down

0 comments on commit b9bed4f

Please sign in to comment.