From 34d616dbef2db2afb6fc393d0d6034add6d46b30 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Sun, 28 Feb 2010 08:58:03 +0000 Subject: [PATCH] enable (dummy) cdkey calls in standalone mode to prevents mods from crashing --- code/client/cl_main.c | 6 ++++-- code/client/cl_ui.c | 13 +++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 7b19ff0d..2b4be3a5 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -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 +} diff --git a/code/client/cl_ui.c b/code/client/cl_ui.c index ed32313b..adda0db1 100644 --- a/code/client/cl_ui.c +++ b/code/client/cl_ui.c @@ -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] );