Merged find_orphaned_cflags and construct_noparam_modes in one function
as there's no reason to use them separetly
This commit is contained in:
parent
4c17be43d3
commit
9bec26cc38
1 changed files with 18 additions and 28 deletions
46
src/chmode.c
46
src/chmode.c
|
@ -66,36 +66,12 @@ static int mode_limit_simple;
|
|||
static int mask_pos;
|
||||
|
||||
int chmode_flags[256];
|
||||
void
|
||||
find_orphaned_cflags(void)
|
||||
{
|
||||
int i;
|
||||
static int prev_chmode_flags[256];
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
if (prev_chmode_flags[i] != 0 && prev_chmode_flags[i] != chmode_flags[i])
|
||||
{
|
||||
if (chmode_flags[i] == 0)
|
||||
{
|
||||
chmode_table[i].set_func = chm_orphaned;
|
||||
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Cmode +%c is now orphaned", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Orphaned cmode +%c is picked up by module", i);
|
||||
}
|
||||
chmode_flags[i] = prev_chmode_flags[i];
|
||||
}
|
||||
else
|
||||
prev_chmode_flags[i] = chmode_flags[i];
|
||||
}
|
||||
}
|
||||
|
||||
/* OPTIMIZE ME! -- dwr */
|
||||
void
|
||||
construct_noparam_modes(void)
|
||||
{
|
||||
int i;
|
||||
static int prev_chmode_flags[256];
|
||||
|
||||
for(i = 0; i < 256; i++)
|
||||
{
|
||||
|
@ -113,9 +89,23 @@ construct_noparam_modes(void)
|
|||
{
|
||||
chmode_flags[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
find_orphaned_cflags();
|
||||
if (prev_chmode_flags[i] != 0 && prev_chmode_flags[i] != chmode_flags[i])
|
||||
{
|
||||
if (chmode_flags[i] == 0)
|
||||
{
|
||||
chmode_table[i].set_func = chm_orphaned;
|
||||
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Cmode +%c is now orphaned", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Orphaned cmode +%c is picked up by module", i);
|
||||
}
|
||||
chmode_flags[i] = prev_chmode_flags[i];
|
||||
}
|
||||
else
|
||||
prev_chmode_flags[i] = chmode_flags[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue