From c0d54f21bcaba56302f5e9475b8182056f4841c0 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 23 Dec 2009 20:58:12 +0000 Subject: [PATCH] do not TOTALLY block translation with csprogs, but restrict it to globals named dotranslate_*. In other progs, all names that do not start with notranslate_* can be translated. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9658 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_edict.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prvm_edict.c b/prvm_edict.c index 0b7c6075..3af88f16 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -2303,10 +2303,11 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required PRVM_Init_Exec(); - if(*prvm_language.string && !strcmp(PRVM_NAME, "client")) + if(*prvm_language.string) // in CSQC we really shouldn't be able to change how stuff works... sorry for now // later idea: include a list of authorized .po file checksums with the csprogs { + qboolean deftrans = !!strcmp(PRVM_NAME, "client"); if(!strcmp(prvm_language.string, "dump")) { qfile_t *f = FS_OpenRealFile(va("%s.%s.po", filename, prvm_language.string), "w", false); @@ -2317,7 +2318,7 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required { const char *name; name = PRVM_GetString(prog->globaldefs[i].s_name); - if(!name || strncmp(name, "notranslate_", 12)) + if(deftrans ? (!name || strncmp(name, "notranslate_", 12)) : (name && !strncmp(name, "dotranslate_"))) if((prog->globaldefs[i].type & ~DEF_SAVEGLOBAL) == ev_string) { prvm_eval_t *val = (prvm_eval_t *)(prog->globals.generic + prog->globaldefs[i].ofs); @@ -2342,7 +2343,7 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required { const char *name; name = PRVM_GetString(prog->globaldefs[i].s_name); - if(!name || strncmp(name, "notranslate_", 12)) + if(deftrans ? (!name || strncmp(name, "notranslate_", 12)) : (name && !strncmp(name, "dotranslate_"))) if((prog->globaldefs[i].type & ~DEF_SAVEGLOBAL) == ev_string) { prvm_eval_t *val = (prvm_eval_t *)(prog->globals.generic + prog->globaldefs[i].ofs); -- 2.39.2