enable (dummy) cdkey calls in standalone mode to prevents mods from crashing

This commit is contained in:
Ludwig Nussel 2010-02-28 08:58:03 +00:00
parent a9fdf0ef3b
commit 34d616dbef
2 changed files with 11 additions and 8 deletions

View file

@ -4162,13 +4162,15 @@ void CL_ShowIP_f(void) {
Sys_ShowIP();
}
#ifndef STANDALONE
/*
=================
bool CL_CDKeyValidate
=================
*/
qboolean CL_CDKeyValidate( const char *key, const char *checksum ) {
#ifdef STANDALONE
return qtrue;
#else
char ch;
byte sum;
char chs[3];
@ -4225,5 +4227,5 @@ qboolean CL_CDKeyValidate( const char *key, const char *checksum ) {
}
return qfalse;
}
#endif
}

View file

@ -625,8 +625,8 @@ static void Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
CLUI_GetCDKey
====================
*/
#ifndef STANDALONE
static void CLUI_GetCDKey( char *buf, int buflen ) {
#ifndef STANDALONE
cvar_t *fs;
fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
if (UI_usesUniqueCDKey() && fs && fs->string[0] != 0) {
@ -636,6 +636,9 @@ static void CLUI_GetCDKey( char *buf, int buflen ) {
Com_Memcpy( buf, cl_cdkey, 16);
buf[16] = 0;
}
#else
*buf = 0;
#endif
}
@ -644,6 +647,7 @@ static void CLUI_GetCDKey( char *buf, int buflen ) {
CLUI_SetCDKey
====================
*/
#ifndef STANDALONE
static void CLUI_SetCDKey( char *buf ) {
cvar_t *fs;
fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
@ -963,15 +967,15 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
case UI_MEMORY_REMAINING:
return Hunk_MemoryRemaining();
#ifndef STANDALONE
case UI_GET_CDKEY:
CLUI_GetCDKey( VMA(1), args[2] );
return 0;
case UI_SET_CDKEY:
#ifndef STANDALONE
CLUI_SetCDKey( VMA(1) );
return 0;
#endif
return 0;
case UI_SET_PBCLSTATUS:
return 0;
@ -1053,11 +1057,8 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
re.RemapShader( VMA(1), VMA(2), VMA(3) );
return 0;
#ifndef STANDALONE
case UI_VERIFY_CDKEY:
return CL_CDKeyValidate(VMA(1), VMA(2));
#endif
default:
Com_Error( ERR_DROP, "Bad UI system trap: %ld", (long int) args[0] );