mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Add MAX_CVARLIST_FILES define
This commit is contained in:
parent
590227aa8d
commit
bd8019da9f
@ -586,7 +586,11 @@ void Cmd_CvarList_f(void)
|
|||||||
{
|
{
|
||||||
// Open log
|
// Open log
|
||||||
int i;
|
int i;
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
for (i = 0; i < MAX_CVARLIST_FILES; i++)
|
||||||
|
#else
|
||||||
for (i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Q_snprintf(szTemp, ARRAYSIZE(szTemp) - 1, "cvarlist%02d.txt", i);
|
Q_snprintf(szTemp, ARRAYSIZE(szTemp) - 1, "cvarlist%02d.txt", i);
|
||||||
szTemp[ARRAYSIZE(szTemp) - 1] = 0;
|
szTemp[ARRAYSIZE(szTemp) - 1] = 0;
|
||||||
@ -599,7 +603,11 @@ void Cmd_CvarList_f(void)
|
|||||||
FS_Close(fp);
|
FS_Close(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
if (i == MAX_CVARLIST_FILES)
|
||||||
|
#else
|
||||||
if (i >= 100)
|
if (i >= 100)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Con_Printf("Can't cvarlist! Too many existing cvarlist output files in the gamedir!\n");
|
Con_Printf("Can't cvarlist! Too many existing cvarlist output files in the gamedir!\n");
|
||||||
return;
|
return;
|
||||||
|
@ -34,6 +34,15 @@
|
|||||||
|
|
||||||
#define MAX_CVAR_VALUE 1024
|
#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
|
#ifdef HOOK_ENGINE
|
||||||
#define cvar_vars (*pcvar_vars)
|
#define cvar_vars (*pcvar_vars)
|
||||||
#endif // HOOK_ENGINE
|
#endif // HOOK_ENGINE
|
||||||
|
Loading…
Reference in New Issue
Block a user