From: divverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed, 20 Apr 2011 13:56:53 +0000 (+0000)
Subject: do NOT use the crc inside the file name for .po file loading
X-Git-Tag: xonotic-v0.6.0~163^2~473
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=57ef90a25a912906da171e0f7d0e6bd89f883ba5;p=xonotic%2Fdarkplaces.git

do NOT use the crc inside the file name for .po file loading

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11073 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/prvm_edict.c b/prvm_edict.c
index 18238abb..c62ea463 100644
--- a/prvm_edict.c
+++ b/prvm_edict.c
@@ -2335,6 +2335,7 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, const char **re
 	// later idea: include a list of authorized .po file checksums with the csprogs
 	{
 		qboolean deftrans = !!strcmp(PRVM_NAME, "client");
+		const char *realfilename = (strcmp(PRVM_NAME, "client") ? filename : sv.csqc_progname);
 		if(deftrans) // once we have dotranslate_ strings, ALWAYS use the opt-in method!
 		{
 			for (i=0 ; i<prog->progs->numglobaldefs ; i++)
@@ -2351,8 +2352,8 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, const char **re
 		}
 		if(!strcmp(prvm_language.string, "dump"))
 		{
-			qfile_t *f = FS_OpenRealFile(va("%s.pot", filename), "w", false);
-			Con_Printf("Dumping to %s.pot\n", filename);
+			qfile_t *f = FS_OpenRealFile(va("%s.pot", realfilename), "w", false);
+			Con_Printf("Dumping to %s.pot\n", realfilename);
 			if(f)
 			{
 				for (i=0 ; i<prog->progs->numglobaldefs ; i++)
@@ -2377,7 +2378,7 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, const char **re
 		}
 		else
 		{
-			po_t *po = PRVM_PO_Load(va("%s.%s.po", filename, prvm_language.string), prog->progs_mempool);
+			po_t *po = PRVM_PO_Load(va("%s.%s.po", realfilename, prvm_language.string), prog->progs_mempool);
 			if(po)
 			{
 				for (i=0 ; i<prog->progs->numglobaldefs ; i++)