core/smn_hudtext.cpp
changeset 2816 4e853c011546
parent 2289 44045ead61cd
child 3010 8ea042c00c80
     1.1 --- a/core/smn_hudtext.cpp	Fri Oct 02 03:47:42 2009 -0700
     1.2 +++ b/core/smn_hudtext.cpp	Fri Oct 02 04:30:46 2009 -0700
     1.3 @@ -42,7 +42,7 @@
     1.4  
     1.5  struct hud_syncobj_t
     1.6  {
     1.7 -	int *player_channels;
     1.8 +	int player_channels[256 + 1];
     1.9  };
    1.10  
    1.11  struct player_chaninfo_t
    1.12 @@ -116,7 +116,6 @@
    1.13  	{
    1.14  		hud_syncobj_t *obj = (hud_syncobj_t *)object;
    1.15  
    1.16 -		delete [] obj->player_channels;
    1.17  		delete obj;
    1.18  	}
    1.19  
    1.20 @@ -138,27 +137,19 @@
    1.21  	Handle_t CreateHudSyncObj(IdentityToken_t *pIdent)
    1.22  	{
    1.23  		Handle_t hndl;
    1.24 -		int max_clients;
    1.25  		HandleError err;
    1.26  		hud_syncobj_t *obj;
    1.27  		HandleSecurity sec;
    1.28  
    1.29 -		if ((max_clients = g_Players.MaxClients()) == 0)
    1.30 -		{
    1.31 -			max_clients = 256+1;
    1.32 -		}
    1.33 +		obj = new hud_syncobj_t;
    1.34  
    1.35 -		obj = new hud_syncobj_t;
    1.36 -		obj->player_channels = new int[max_clients];
    1.37 -
    1.38 -		memset(obj->player_channels, 0, sizeof(int) * max_clients);
    1.39 +		memset(obj->player_channels, 0, sizeof(obj->player_channels));
    1.40  
    1.41  		sec = HandleSecurity(pIdent, g_pCoreIdent);
    1.42  		
    1.43  		if ((hndl = g_HandleSys.CreateHandleEx(m_hHudSyncObj, obj, &sec, NULL, &err))
    1.44  			== BAD_HANDLE)
    1.45  		{
    1.46 -			delete [] obj->player_channels;
    1.47  			delete obj;
    1.48  		}
    1.49