mirror of
https://github.com/anope/anope.git
synced 2026-07-02 14:33:13 +02:00
Don't dynamically allocate commands in modules anymore, instead made them members of modules. This means the commands are automatically destructed when the module is unloaded. Cleans up some old ugly code.
This commit is contained in:
@@ -78,14 +78,16 @@ class CommandCSKick : public Command
|
||||
|
||||
class CSKick : public Module
|
||||
{
|
||||
CommandCSKick commandcskick, commandcsk;
|
||||
|
||||
public:
|
||||
CSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
|
||||
CSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator), commandcskick("KICK"), commandcsk("K")
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(ChanServ, new CommandCSKick("KICK"));
|
||||
this->AddCommand(ChanServ, new CommandCSKick("K"));
|
||||
this->AddCommand(ChanServ, &commandcskick);
|
||||
this->AddCommand(ChanServ, &commandcsk);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user