mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
Make qw's cl.players dynamically allocated.
This commit is contained in:
parent
13677bc5d3
commit
bc8e37332c
2 changed files with 5 additions and 1 deletions
|
@ -266,7 +266,7 @@ typedef struct {
|
|||
int cdtrack; // cd audio
|
||||
|
||||
// all player information
|
||||
player_info_t players[MAX_CLIENTS];
|
||||
player_info_t *players;
|
||||
|
||||
lightstyle_t lightstyle[MAX_LIGHTSTYLES];
|
||||
} client_state_t;
|
||||
|
|
|
@ -395,7 +395,10 @@ CL_ClearState (void)
|
|||
// wipe the entire cl structure
|
||||
if (cl.serverinfo)
|
||||
Info_Destroy (cl.serverinfo);
|
||||
if (cl.players)
|
||||
free (cl.players);
|
||||
memset (&cl, 0, sizeof (cl));
|
||||
cl.players = calloc (MAX_CLIENTS, sizeof (player_info_t));
|
||||
r_data->force_fullscreen = 0;
|
||||
|
||||
cl.maxclients = MAX_CLIENTS;
|
||||
|
@ -1219,6 +1222,7 @@ CL_Init (void)
|
|||
cls.downloadname = dstring_newstr ();
|
||||
cls.downloadurl = dstring_newstr ();
|
||||
cl.serverinfo = Info_ParseString ("", MAX_INFO_STRING, 0);
|
||||
cl.players = calloc (MAX_CLIENTS, sizeof (player_info_t));
|
||||
|
||||
// register our commands
|
||||
Cmd_AddCommand ("version", CL_Version_f, "Report version information");
|
||||
|
|
Loading…
Reference in a new issue