Skip to content

Commit

Permalink
fix unnecessary left the game message when eliminated player disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomenor committed Sep 15, 2023
1 parent 89e1d8e commit 89eac84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/game/mods/modes/elimination/elim_tweaks.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ static void MOD_PREFIX(PostPlayerDie)( MODFN_CTV, gentity_t *self, gentity_t *in
*/
static void MOD_PREFIX(PrePlayerLeaveTeam)( MODFN_CTV, int clientNum, team_t oldTeam ) {
gclient_t *client = &level.clients[clientNum];
MODFN_NEXT( PrePlayerLeaveTeam, ( MODFN_NC, clientNum, oldTeam ) );

#ifdef FEATURE_ELIMINATED_MESSAGES
if ( level.matchState == MS_ACTIVE && client->pers.connected == CON_CONNECTED &&
Expand All @@ -246,6 +245,10 @@ static void MOD_PREFIX(PrePlayerLeaveTeam)( MODFN_CTV, int clientNum, team_t old
ModElimTweaks_EliminatedMessage( clientNum, oldTeam, qfalse );
}
#endif

// Call this last, since it may reset eliminated status in elim_main.c
// and break ModElimination_Static_IsPlayerEliminated.
MODFN_NEXT( PrePlayerLeaveTeam, ( MODFN_NC, clientNum, oldTeam ) );
}

/*
Expand Down

0 comments on commit 89eac84

Please sign in to comment.