diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mode.cpp | 5 | ||||
-rw-r--r-- | src/users.cpp | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 68d7e0bd0..62dd61f4c 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -76,6 +76,11 @@ unsigned int ModeHandler::GetCount() return 0; } +void ModeHandler::ChangeCount(int modifier) +{ + count += modifier; +} + ModeType ModeHandler::GetModeType() { return m_type; diff --git a/src/users.cpp b/src/users.cpp index b4f25a75e..c01c4e4b6 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -289,6 +289,19 @@ const char* userrec::FormatModes() return data; } +void userrec::DecrementModes() +{ + for (int n = 0; n < 64; n++) + { + if (modes[n]) + { + ModeHandler* mh = ServerInstance->Modes->FindMode(n+65, MODETYPE_USER); + if (mh) + mh->ChangeCount(-1); + } + } +} + userrec::userrec(InspIRCd* Instance) : ServerInstance(Instance) { ServerInstance->Log(DEBUG,"userrec::userrec(): Instance: %08x",ServerInstance); @@ -317,7 +330,7 @@ userrec::userrec(InspIRCd* Instance) : ServerInstance(Instance) userrec::~userrec() { this->InvalidateCache(); - + this->DecrementModes(); if (ip) { clonemap::iterator x = ServerInstance->local_clones.find(this->GetIPString()); |