]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Only call events on modules which aren't dying.
[user/henk/code/inspircd.git] / include / modules.h
index cd4fdce05164cb687eb1976e663c549c400be51d..45d2dd492e82479c40172aba51652f177bcf41b0 100644 (file)
@@ -107,7 +107,7 @@ struct ModResult {
  * and numerical comparisons in preprocessor macros if they wish to support
  * multiple versions of InspIRCd in one file.
  */
-#define INSPIRCD_VERSION_API 5
+#define INSPIRCD_VERSION_API 6
 
 /**
  * This #define allows us to call a method in all
@@ -121,7 +121,8 @@ struct ModResult {
                _next = _i+1; \
                try \
                { \
-                       (*_i)->y x ; \
+                       if (!(*_i)->dying) \
+                               (*_i)->y x ; \
                } \
                catch (CoreException& modexcept) \
                { \
@@ -144,7 +145,8 @@ do { \
                _next = _i+1; \
                try \
                { \
-                       v = (*_i)->n args;
+                       if (!(*_i)->dying) \
+                               v = (*_i)->n args;
 
 #define WHILE_EACH_HOOK(n) \
                } \