diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 1458477c..1f3c3649 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -942,7 +942,15 @@ void process_change_ship(shared_ptr s, shared_ptr c, // things, which we already know). We intentionally don't call check_size // here, but instead just ignore the data. - send_message_box(c, u""); // we do this to avoid the "log window in message box" bug + // Delete the player from the lobby they're in (but only visible to themself). + // This makes it safe to allow the player to choose download quests from the + // main menu again - if we didn't do this, they could move in the lobby after + // canceling the download quests menu, which looks really bad. + send_self_leave_notification(c); + + // Sending a blank message box here works around the bug where the log window + // contents appear prepended to the next large message box. + send_message_box(c, u""); static const vector version_to_port_name({ "dc-login", "pc-login", "bb-patch", "gc-us3", "bb-login"}); @@ -954,7 +962,7 @@ void process_change_ship(shared_ptr s, shared_ptr c, void process_change_block(shared_ptr s, shared_ptr c, uint16_t command, uint32_t flag, const string& data) { // A1 - // newserv doesn't have blocks; treat block change as ship change + // newserv doesn't have blocks; treat block change the same as ship change process_change_ship(s, c, command, flag, data); } diff --git a/src/SendCommands.cc b/src/SendCommands.cc index a411dd72..6d4c8240 100644 --- a/src/SendCommands.cc +++ b/src/SendCommands.cc @@ -1059,6 +1059,11 @@ void send_player_leave_notification(shared_ptr l, uint8_t leaving_client_ send_command_t(l, l->is_game() ? 0x66 : 0x69, leaving_client_id, cmd); } +void send_self_leave_notification(shared_ptr c) { + S_LeaveLobby_66_69 cmd = {c->lobby_client_id, 0, 0}; + send_command_t(c, 0x69, c->lobby_client_id, cmd); +} + void send_get_player_info(shared_ptr c) { send_command(c, 0x95, 0x00); } diff --git a/src/SendCommands.hh b/src/SendCommands.hh index 0367708a..25b7ce83 100644 --- a/src/SendCommands.hh +++ b/src/SendCommands.hh @@ -167,6 +167,7 @@ void send_player_join_notification(std::shared_ptr c, std::shared_ptr l, std::shared_ptr joining_client); void send_player_leave_notification(std::shared_ptr l, uint8_t leaving_client_id); +void send_self_leave_notification(std::shared_ptr c); void send_get_player_info(std::shared_ptr c); void send_arrow_update(std::shared_ptr l);