diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/commandbuffer.cc | 9 | ||||
-rw-r--r-- | src/core/gameserver.cc | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc index 40517e1..6c4dbca 100644 --- a/src/core/commandbuffer.cc +++ b/src/core/commandbuffer.cc @@ -9,6 +9,7 @@ #include <sstream> #include <list> +#include "auxiliary/functions.h" #include "sys/sys.h" #include "filesystem/filesystem.h" #include "core/application.h" @@ -57,6 +58,8 @@ void func_set(std::string const &args) if (!(argstream >> varname)) return; + aux::to_lowercase(varname); + std::string value; if (!(argstream >> value)) { return; @@ -136,7 +139,8 @@ void CommandBuffer::exec(std::string const &cmdline) if (!(cmdstream >> command)) return; - + + aux::to_lowercase(command); //con_debug << "Executing '" << cmdline << "'\n"; // is it a function @@ -207,7 +211,8 @@ void CommandBuffer::complete(std::string &input, size_t &pos) std::string partial = input.substr(0, pos); if (!partial.size()) return; - + aux::to_lowercase(partial); + // search function registry for matches std::map<std::string, Func *>::iterator f; for (f = Func::registry.begin(); f != Func::registry.end(); f++) { diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index 687623e..5d973f1 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -115,6 +115,8 @@ void GameServer::abort() Player *GameServer::find_player(std::string const search) { + using aux::lowercase; + std::istringstream searchstr(search); int id = 0; if (searchstr >> id) { @@ -129,7 +131,7 @@ Player *GameServer::find_player(std::string const search) return 0; for (std::list<Player *>:: iterator it = players.begin(); it != players.end(); it++) { - if ((*it)->name().find(search) != std::string::npos) + if (lowercase((*it)->name()).find(lowercase(search)) != std::string::npos) return (*it); } |