From 2acd2ce9ba60cd8c1535760d174e821ce345843d Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 28 Jul 2008 21:37:33 +0000 Subject: make the jump command case insensitive --- src/game/game.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/game/game.cc') diff --git a/src/game/game.cc b/src/game/game.cc index efca1be..5a937ca 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -148,14 +148,22 @@ void func_jump(core::Player *player, std::string const &args) core::server()->send(player, "Your ship is not equiped with a jumpdrive"); return; } - - std::string target; + std::string target; std::istringstream is(args); if (!(is >> target)) { - core::server()->send(player, "Usage: jump [system]"); + std::string helpstr; + for (core::Zone::Registry::iterator it = core::Zone::registry().begin(); it != core::Zone::registry().end(); it++) { + core::Zone *zone = (*it).second; + if (helpstr.size()) + helpstr.append("^N|^B"); + helpstr.append(zone->label()); + } + + core::server()->send(player, "Usage: jump [^B" + helpstr + "^N]"); return; } + aux::to_lowercase(target); core::Zone *zone = core::Zone::find_zone(target); if (!zone) { core::server()->send(player, "Unknown system '" + target + '\''); @@ -261,7 +269,7 @@ bool Game::load_world() } else if (worldini.section().compare("world") == 0 ) { if (worldini.got_key_string("zone", label)) { aux::trim(label); - aux::lowercase(label); + aux::to_lowercase(label); zone = new core::Zone(label); core::Zone::add(zone); } -- cgit v1.2.3