engine: get rid of some size constants passed to Info_SetValueForKey, use sizeof instead

This commit is contained in:
Alibek Omarov 2024-07-07 03:01:37 +03:00
parent c42960ec2a
commit e55577fd26
3 changed files with 6 additions and 6 deletions

View File

@ -2788,7 +2788,7 @@ static void GAME_EXPORT PlayerInfo_SetValueForKey( const char *key, const char *
{
Cvar_DirectSet( var, value );
}
else if( Info_SetValueForStarKey( cls.userinfo, key, value, MAX_INFO_STRING ))
else if( Info_SetValueForStarKey( cls.userinfo, key, value, sizeof( cls.userinfo )))
{
// time to update server copy of userinfo
CL_UpdateInfo( key, value );

View File

@ -2781,7 +2781,7 @@ static void CL_SetInfo_f( void )
{
Cvar_DirectSet( var, Cmd_Argv( 2 ));
}
else if( Info_SetValueForKey( cls.userinfo, Cmd_Argv( 1 ), Cmd_Argv( 2 ), MAX_INFO_STRING ))
else if( Info_SetValueForKey( cls.userinfo, Cmd_Argv( 1 ), Cmd_Argv( 2 ), sizeof( cls.userinfo )))
{
// send update only on successfully changed userinfo
Cmd_ForwardToServer ();

View File

@ -532,10 +532,10 @@ edict_t *GAME_EXPORT SV_FakeConnect( const char *netname )
userinfo[0] = '\0';
// setup fake client params
Info_SetValueForKey( userinfo, "name", netname, MAX_INFO_STRING );
Info_SetValueForKey( userinfo, "model", "gordon", MAX_INFO_STRING );
Info_SetValueForKey( userinfo, "topcolor", "1", MAX_INFO_STRING );
Info_SetValueForKey( userinfo, "bottomcolor", "1", MAX_INFO_STRING );
Info_SetValueForKey( userinfo, "name", netname, sizeof( userinfo ));
Info_SetValueForKey( userinfo, "model", "gordon", sizeof( userinfo ));
Info_SetValueForKey( userinfo, "topcolor", "1", sizeof( userinfo ));
Info_SetValueForKey( userinfo, "bottomcolor", "1", sizeof( userinfo ));
// build a new connection
// accept the new client