mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Do not save cleared ban list when reloading bans
This commit is contained in:
parent
e9fce20071
commit
288ffebea7
1 changed files with 16 additions and 12 deletions
|
@ -2918,16 +2918,14 @@ static void Ban_Add(const char *reason)
|
|||
reasontail = reasonlist;
|
||||
}
|
||||
|
||||
static void Command_ClearBans(void)
|
||||
static void Ban_Clear(void)
|
||||
{
|
||||
banreason_t *temp;
|
||||
|
||||
if (!I_ClearBans)
|
||||
return;
|
||||
|
||||
I_ClearBans();
|
||||
D_SaveBan();
|
||||
|
||||
reasontail = NULL;
|
||||
|
||||
while (reasonhead)
|
||||
{
|
||||
temp = reasonhead->next;
|
||||
|
@ -2937,6 +2935,15 @@ static void Command_ClearBans(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Command_ClearBans(void)
|
||||
{
|
||||
if (!I_ClearBans)
|
||||
return;
|
||||
|
||||
Ban_Clear();
|
||||
D_SaveBan();
|
||||
}
|
||||
|
||||
static void Ban_Load_File(boolean warning)
|
||||
{
|
||||
FILE *f;
|
||||
|
@ -2944,6 +2951,9 @@ static void Ban_Load_File(boolean warning)
|
|||
const char *address, *mask;
|
||||
char buffer[MAX_WADPATH];
|
||||
|
||||
if (!I_ClearBans)
|
||||
return;
|
||||
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "ban.txt"), "r");
|
||||
|
||||
if (!f)
|
||||
|
@ -2953,13 +2963,7 @@ static void Ban_Load_File(boolean warning)
|
|||
return;
|
||||
}
|
||||
|
||||
if (I_ClearBans)
|
||||
Command_ClearBans();
|
||||
else
|
||||
{
|
||||
fclose(f);
|
||||
return;
|
||||
}
|
||||
Ban_Clear();
|
||||
|
||||
for (i=0; fgets(buffer, (int)sizeof(buffer), f); i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue