diff options
Diffstat (limited to 'src/modules/m_nicklock.cpp')
-rw-r--r-- | src/modules/m_nicklock.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 315f8390e..36bf0598d 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -55,11 +55,12 @@ class cmd_nicklock : public command_t { // give them a lock flag Srv->SendOpers(std::string(user->nick)+" used NICKLOCK to change and hold "+std::string(parameters[0])+" to "+parameters[1]); - Srv->ChangeUserNick(source,std::string(parameters[1])); - // only attempt to set their lockflag after we know the change succeeded - source = Srv->FindNick(std::string(parameters[1])); - if (source) - source->Extend("nick_locked", "ON"); + if (!source->ForceNickChange(parameters[1])) + { + userrec::QuitUser(source, "Nickname collision"); + return; + } + source->Extend("nick_locked", "ON"); } } } |