Skip to content

Commit

Permalink
Clear solid state on Client disconnect and reconnect
Browse files Browse the repository at this point in the history
In case of rejoin too fast disconnect and was previously not a spectator.
  • Loading branch information
ensiform committed Jul 29, 2024
1 parent 191fd55 commit 29fc640
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/game/g_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@ const char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
trap_UnlinkEntity( ent );
ent->r.contents = 0;
ent->s.eType = ET_INVISIBLE;
ent->s.solid = 0;
ent->s.eFlags = 0;
ent->s.modelindex = 0;
ent->s.clientNum = clientNum;
Expand Down Expand Up @@ -2360,13 +2361,18 @@ void ClientDisconnect( int clientNum ) {
G_LogPrintf( "ClientDisconnect: %i\n", clientNum );

trap_UnlinkEntity( ent );
ent->r.contents = 0;
ent->s.eType = ET_INVISIBLE;
ent->s.solid = 0;
ent->s.eFlags = 0;
ent->s.modelindex = 0;
ent->inuse = qfalse;
ent->classname = "disconnected";
ent->client->pers.connected = CON_DISCONNECTED;
ent->client->ps.persistant[PERS_TEAM] = TEAM_FREE;
i = ent->client->sess.sessionTeam;
ent->client->sess.sessionTeam = TEAM_FREE;
ent->takedamage = qfalse;
ent->active = qfalse;

trap_SetConfigstring( CS_PLAYERS + clientNum, "" );
Expand Down

0 comments on commit 29fc640

Please sign in to comment.