2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Add MAX_CVARLIST_FILES define

This commit is contained in:
In-line 2017-02-20 19:08:07 +04:00
parent 590227aa8d
commit bd8019da9f
2 changed files with 17 additions and 0 deletions

View File

@ -586,7 +586,11 @@ void Cmd_CvarList_f(void)
{
// Open log
int i;
#ifdef REHLDS_FIXES
for (i = 0; i < MAX_CVARLIST_FILES; i++)
#else
for (i = 0; i < 100; i++)
#endif
{
Q_snprintf(szTemp, ARRAYSIZE(szTemp) - 1, "cvarlist%02d.txt", i);
szTemp[ARRAYSIZE(szTemp) - 1] = 0;
@ -599,7 +603,11 @@ void Cmd_CvarList_f(void)
FS_Close(fp);
}
#ifdef REHLDS_FIXES
if (i == MAX_CVARLIST_FILES)
#else
if (i >= 100)
#endif
{
Con_Printf("Can't cvarlist! Too many existing cvarlist output files in the gamedir!\n");
return;

View File

@ -34,6 +34,15 @@
#define MAX_CVAR_VALUE 1024
#ifdef REHLDS_FIXES
#define MAX_CVARLIST_FILES 100
#if (MAX_CVARLIST_FILES < 0 || MAX_CVARLIST_FILES > 100) // Code in Cmd_CvarList_f handles only value between 0-99
#error "MAX_CVARLIST_FILES value is out of bound"
#endif
#endif
#ifdef HOOK_ENGINE
#define cvar_vars (*pcvar_vars)
#endif // HOOK_ENGINE