Put console_history.txt in the binary dir when fs_portable is 1.

This commit is contained in:
Yamagi Burmeister 2017-03-13 15:41:41 +01:00
parent 00758277f1
commit 3032698f95
3 changed files with 23 additions and 7 deletions

View file

@ -785,7 +785,15 @@ Key_WriteConsoleHistory()
{
int i;
char path[MAX_OSPATH];
Com_sprintf(path, sizeof(path), "%sconsole_history.txt", Sys_GetHomeDir());
if (fs_portable->value)
{
Com_sprintf(path, sizeof(path), "%sconsole_history.txt", Sys_GetBinaryDir());
}
else
{
Com_sprintf(path, sizeof(path), "%sconsole_history.txt", Sys_GetHomeDir());
}
FILE* f = fopen(path, "w");
@ -824,7 +832,15 @@ Key_ReadConsoleHistory()
int i;
char path[MAX_OSPATH];
Com_sprintf(path, sizeof(path), "%sconsole_history.txt", Sys_GetHomeDir());
if (fs_portable->value)
{
Com_sprintf(path, sizeof(path), "%sconsole_history.txt", Sys_GetBinaryDir());
}
else
{
Com_sprintf(path, sizeof(path), "%sconsole_history.txt", Sys_GetHomeDir());
}
FILE* f = fopen(path, "r");
if(f==NULL)

View file

@ -943,11 +943,10 @@ FS_AddHomeAsGameDirectory(char *dir)
char gdir[MAX_OSPATH];
size_t len;
if (fs_portable->value)
{
Com_Printf("======================>>>>>>>>>>>> Portableflappen\n");
return;
}
if (fs_portable->value)
{
return;
}
home = Sys_GetHomeDir();

View file

@ -726,6 +726,7 @@ extern cvar_t *modder;
extern cvar_t *dedicated;
extern cvar_t *host_speeds;
extern cvar_t *log_stats;
extern cvar_t *fs_portable;
extern FILE *log_stats_file;