Log command name collisions

develop
lethosor 2015-04-01 17:32:11 -04:00
parent 82d72007fc
commit 8b5b8ed864
1 changed files with 7 additions and 1 deletions

@ -793,7 +793,13 @@ void PluginManager::registerCommands( Plugin * p )
vector <PluginCommand> & cmds = p->commands; vector <PluginCommand> & cmds = p->commands;
for(size_t i = 0; i < cmds.size();i++) for(size_t i = 0; i < cmds.size();i++)
{ {
belongs[cmds[i].name] = p; std::string name = cmds[i].name;
if (belongs.find(name) != belongs.end())
{
fprintf(stderr, "Plugin %s re-implements command \"%s\" (from plugin %s)\n",
p->getName().c_str(), name.c_str(), belongs[name]->getName().c_str());
}
belongs[name] = p;
} }
if (p->plugin_eval_ruby) if (p->plugin_eval_ruby)
ruby = p; ruby = p;