From 67878d628c15f2adec41b6d3b266830a636c2ed0 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 28 Dec 2006 16:55:50 +0000 Subject: Reasonably sized fix - when adding modes in modules, be sure to check the return value so we dont load two modules with conflicting modes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6137 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_services.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/m_services.cpp') diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index bd656b042..1eb089d0c 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -185,11 +185,13 @@ class ModuleServices : public Module m3 = new Channel_M(ServerInstance); m4 = new User_r(ServerInstance); m5 = new User_R(ServerInstance); - ServerInstance->AddMode(m1, 'r'); - ServerInstance->AddMode(m2, 'R'); - ServerInstance->AddMode(m3, 'M'); - ServerInstance->AddMode(m4, 'r'); - ServerInstance->AddMode(m5, 'R'); + + if (!ServerInstance->AddMode(m1, 'r') || !ServerInstance->AddMode(m2, 'R') || !ServerInstance->AddMode(m3, 'M') + || !ServerInstance->AddMode(m4, 'r') || !ServerInstance->AddMode(m5, 'R')) + { + throw ModuleException("Could not add user and channel modes!"); + } + kludgeme = false; } -- cgit v1.2.3