Fix chansaver loading

CModules::LoadModule() sets the module type _after_ construction.
The constructor cannot therefore do actions based on the module
type. Move loading to OnLoad().
This commit is contained in:
J-P Nurmi
2015-02-28 21:15:23 +01:00
parent de50d75c01
commit 1180467a87
+7 -3
View File
@@ -21,6 +21,12 @@
class CChanSaverMod : public CModule {
public:
MODCONSTRUCTOR(CChanSaverMod) {
}
virtual ~CChanSaverMod() {
}
bool OnLoad(const CString& sArgsi, CString& sMessage) override {
switch (GetType()) {
case CModInfo::GlobalModule:
LoadUsers();
@@ -32,9 +38,7 @@ public:
LoadNetwork(GetNetwork());
break;
}
}
virtual ~CChanSaverMod() {
return true;
}
void LoadUsers() {