Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-07-28 21:37:33 +0000
committerStijn Buys <ingar@osirion.org>2008-07-28 21:37:33 +0000
commit2acd2ce9ba60cd8c1535760d174e821ce345843d (patch)
tree08d9f26126a41937f34816947a9a13e61cd167ed /src
parentc71aa43f1aeb92b2607e025207919b9d6e970553 (diff)
make the jump command case insensitive
Diffstat (limited to 'src')
-rw-r--r--src/game/game.cc16
1 files changed, 12 insertions, 4 deletions
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);
}