Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-06-07 18:13:15 +0000
committerStijn Buys <ingar@osirion.org>2009-06-07 18:13:15 +0000
commitf33257521bf80dcef8575c4fc3ddaf4a40ff588a (patch)
tree5e3a112e814478ba3ab624e0867761654a5ea0a4 /src/game/base/game.cc
parent5b94df1df2707b36401d91d80b92d0e4cdfd2277 (diff)
fixed a few widget order problems, changed map targetting behaviour
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r--src/game/base/game.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index da060b9..4128af8 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -195,17 +195,27 @@ void Game::func_dock(core::Player *player, core::Entity *entity)
void Game::func_buy(core::Player *player, const std::string &args)
{
std::istringstream is(args);
+ std::string itemclass;
std::string itemtype;
- if (!(is >> itemtype)) {
- player->send("usage: buy [string] [string] buy type of item, name of item");
+
+ if (!(is >> itemclass)) {
+ player->send("usage: buy [string] [string] buy an item of a specified class and type");
return;
+ } else {
+ aux::to_label(itemclass);
+ }
+
+ if (!(is >> itemtype)) {
+ itemtype.clear();
+ } else {
+ aux::to_label(itemtype);
}
- aux::to_label(itemtype);
- if ((args.size() > 5 ) && (itemtype.compare("ship") == 0)) {
- ShipDealer::func_buy(player, args.substr(5, args.size() - 5));
+
+ if (itemclass.compare("ship") == 0) {
+ ShipDealer::func_buy(player, itemtype);
} else {
- player->send("unkown item type '" + itemtype + "'");
+ player->send("unkown item class '" + itemclass + "'");
}
return;