diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 26ea363d..77702070 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -231,6 +231,12 @@ static void send_main_menu(shared_ptr s, shared_ptr c) { } void on_login_complete(shared_ptr s, shared_ptr c) { + if (c->flags & Client::Flag::IS_EPISODE_3) { + auto team = s->ep3_tournament_index->team_for_serial_number(c->license->serial_number); + auto tourn = team ? team->tournament.lock() : nullptr; + c->ep3_tournament_team = team; + } + // On the BB data server, this function is called only on the last connection // (when we should send the ship select menu). if ((c->server_behavior == ServerBehavior::LOGIN_SERVER) || @@ -2498,10 +2504,9 @@ static void on_61_98(shared_ptr s, shared_ptr c, // login sequence. if ((c->flags & Client::Flag::IS_EPISODE_3) && !(c->flags & Client::Flag::HAS_EP3_CARD_DEFS)) { send_ep3_card_list_update(s, c); - auto team = s->ep3_tournament_index->team_for_serial_number(c->license->serial_number); + auto team = c->ep3_tournament_team.lock(); auto tourn = team ? team->tournament.lock() : nullptr; - c->ep3_tournament_team = team; - if (!(c->flags & Client::Flag::IS_EP3_TRIAL_EDITION)) { + if (tourn && !(c->flags & Client::Flag::IS_EP3_TRIAL_EDITION)) { send_ep3_confirm_tournament_entry(s, c, tourn); } }