| 1790 | |
| 1791 | |
| 1792 | void cPluginManager::TabCompleteCommand(const AString & a_Text, AStringVector & a_Results, cPlayer * a_Player) |
| 1793 | { |
| 1794 | for (CommandMap::iterator itr = m_Commands.begin(), end = m_Commands.end(); itr != end; ++itr) |
| 1795 | { |
| 1796 | if (NoCaseCompare(itr->first.substr(0, a_Text.length()), a_Text) != 0) |
| 1797 | { |
| 1798 | // Command name doesn't match |
| 1799 | continue; |
| 1800 | } |
| 1801 | if ((a_Player != NULL) && !a_Player->HasPermission(itr->second.m_Permission)) |
| 1802 | { |
| 1803 | // Player doesn't have permission for the command |
| 1804 | continue; |
| 1805 | } |
| 1806 | a_Results.push_back(itr->first); |
| 1807 | } |
| 1808 | } |
| 1809 | |
| 1810 | |
| 1811 |
no test coverage detected