Merge pull request #82 from petr666/master

Generate random suffix for default player name
This commit is contained in:
Simon 2022-05-14 12:20:19 +01:00 committed by GitHub
commit 8cf2ffc445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3622,7 +3622,12 @@ void CL_Init( void ) {
cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60", CVAR_ARCHIVE);
// userinfo
Cvar_Get ("name", "[VR] Player", CVAR_USERINFO | CVAR_ARCHIVE );
char playerName[256];
Com_sprintf(playerName, 256, "[VR] Player#%i", rand() % (99999999 - 10000000) + 10000000);
Cvar_Get ("name", playerName, CVAR_USERINFO | CVAR_ARCHIVE );
if (strcmp(Cvar_VariableString("name"), "[VR] Player") == 0) {
Cvar_Set( "name", playerName);
}
cl_rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("snaps", "40", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("model", "sarge", CVAR_USERINFO | CVAR_ARCHIVE );