diff --git a/Changes b/Changes index 64e961836..2f6db3ae7 100644 --- a/Changes +++ b/Changes @@ -1180,3 +1180,7 @@ which basically means if it allows .*. If you want to require a parameter, use .+ (or anything other in regex that requires at least one character). Suggested and patch provided by Nazzy (#0002722). +- Fixed oper count bug which happened on /mode, this was our fault (can't blame services in + this case ;p). Reported by KnAseN and many others (#0002581). + There might still be other operator count bugs, but these are triggered by a different bug + and may or may not be caused by services. diff --git a/src/modules/m_mode.c b/src/modules/m_mode.c index 77e210fa5..698d856d2 100644 --- a/src/modules/m_mode.c +++ b/src/modules/m_mode.c @@ -2346,18 +2346,21 @@ DLLFUNC CMD_FUNC(_m_umode) if (!(setflags & UMODE_OPER) && IsOper(sptr)) IRCstats.operators++; + + /* deal with opercounts and stuff */ if ((setflags & UMODE_OPER) && !IsOper(sptr)) { IRCstats.operators--; VERIFY_OPERCOUNT(sptr, "umode1"); - } - /* FIXME: This breaks something */ + } else /* YES this 'else' must be here, otherwise we can decrease twice. fixes opercount bug. */ if (!(setflags & UMODE_HIDEOPER) && IsHideOper(sptr)) { if (IsOper(sptr)) /* decrease, but only if GLOBAL oper */ IRCstats.operators--; VERIFY_OPERCOUNT(sptr, "umode2"); } + /* end of dealing with opercounts */ + if ((setflags & UMODE_HIDEOPER) && !IsHideOper(sptr)) { if (IsOper(sptr)) /* increase, but only if GLOBAL oper */