Skip to content

Commit 10bd8e3

Browse files
committed
Discard Pending LobbyEnter_t on LeaveLobby
1 parent f369f47 commit 10bd8e3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

dll/steam_matchmaking.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,15 @@ void Steam_Matchmaking::LeaveLobby( CSteamID steamIDLobby )
686686
PRINT_DEBUG_ENTRY();
687687
std::lock_guard<std::recursive_mutex> lock(global_mutex);
688688
PRINT_DEBUG("pass mutex");
689+
690+
// Discard any deferred LobbyEnter_t; no point delivering an enter for a lobby that’s already being left
691+
pending_lobby_enters.erase(
692+
std::remove_if(pending_lobby_enters.begin(), pending_lobby_enters.end(),
693+
[&steamIDLobby](const Pending_Lobby_Enter &p) {
694+
return p.lobby_id == steamIDLobby.ConvertToUint64();
695+
}),
696+
pending_lobby_enters.end());
697+
689698
Lobby *lobby = get_lobby(steamIDLobby);
690699
if (lobby) {
691700
if (!lobby->deleted()) {

0 commit comments

Comments
 (0)