diff options
author | Adam <Adam@anope.org> | 2012-10-08 20:58:47 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-10-08 20:58:47 -0400 |
commit | 3af786d4c97e8ee99ea122a5c058d82e6222f295 (patch) | |
tree | 750c5de0ec2c001b6366fd5137478e6944cdc296 /src | |
parent | e57b470e83fac205a354138b1daccec654214e39 (diff) |
Fix fantasy !help & give it its own help header, not ChanServ's
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 7 | ||||
-rw-r--r-- | src/command.cpp | 10 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 38f37c41d..bc7fc3cb0 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -230,10 +230,7 @@ void BotInfo::OnMessage(User *u, const Anope::string &message) if (this->commands.empty()) return; - CommandSource source(u->nick, u, u->Account(), u); - source.owner = this; - source.service = this; - + CommandSource source(u->nick, u, u->Account(), u, this); RunCommand(source, message); } @@ -256,7 +253,7 @@ void BotInfo::SetCommand(const Anope::string &cname, const Anope::string &sname, */ CommandInfo *BotInfo::GetCommand(const Anope::string &cname) { - command_map::iterator it = this->commands.find(cname); + CommandInfo::map::iterator it = this->commands.find(cname); if (it != this->commands.end()) return &it->second; return NULL; diff --git a/src/command.cpp b/src/command.cpp index 976f89de7..6ae9275ca 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -17,8 +17,8 @@ #include "regchannel.h" #include "channels.h" -CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *r) : nick(n), u(user), nc(core), reply(r), - c(NULL), owner(NULL), service(NULL) +CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *r, BotInfo *bi) : nick(n), u(user), nc(core), reply(r), + c(NULL), service(bi) { } @@ -153,7 +153,7 @@ void Command::SendSyntax(CommandSource &source) void Command::SendSyntax(CommandSource &source, const Anope::string &syn) { source.Reply(_("Syntax: \002%s %s\002"), source.command.c_str(), syn.c_str()); - source.Reply(MORE_INFO, Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str(), source.command.c_str()); + source.Reply(MORE_INFO, Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str(), source.command.c_str()); } const Anope::string &Command::GetDesc() const @@ -171,7 +171,7 @@ bool Command::OnHelp(CommandSource &source, const Anope::string &subcommand) { r void Command::OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { this->SendSyntax(source); - source.Reply(MORE_INFO, Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str(), source.command.c_str()); + source.Reply(MORE_INFO, Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str(), source.command.c_str()); } void RunCommand(CommandSource &source, const Anope::string &message) @@ -179,7 +179,7 @@ void RunCommand(CommandSource &source, const Anope::string &message) std::vector<Anope::string> params = BuildStringVector(message); bool has_help = source.service->commands.find("HELP") != source.service->commands.end(); - BotInfo::command_map::const_iterator it = source.service->commands.end(); + CommandInfo::map::const_iterator it = source.service->commands.end(); unsigned count = 0; for (unsigned max = params.size(); it == source.service->commands.end() && max > 0; --max) { |