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>2014-12-13 14:27:26 +0000
committerStijn Buys <ingar@osirion.org>2014-12-13 14:27:26 +0000
commit2c4d6e947546f2732dd59d13fb331ec1412315ee (patch)
tree0eff7023435767cb1deace51f0dbd9e26016e0cd /src/game/base/game.cc
parentf58c9992f6a6006213123c2fc2cda0d0f055494b (diff)
Use messagebox notifications when buying a ship.
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r--src/game/base/game.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index f802ff2..4703aac 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -1006,7 +1006,7 @@ void Game::func_buy(core::Player *player, const std::string &args)
core::Item *item = 0;
unsigned int id = 0;
- int amount = 0;
+ int amount = 0;
std::istringstream is_int(args);
if (is_int >> id >> amount) {
@@ -1021,9 +1021,18 @@ void Game::func_buy(core::Player *player, const std::string &args)
}
if (item->info()->type() == ShipModel::infotype()) {
+ // buying a ship uses a confirmation messagebox
+ bool confirm = false;
+ std::string strconfirm;
+ if (is_int >> strconfirm) {
+ if (strconfirm.compare("confirm") == 0) {
+ confirm = true;
+ }
+ }
+
ShipModel *shipmodel = ShipModel::find(item->info()->label());
if (shipmodel) {
- shipmodel->buy(player->control(), player->view());
+ shipmodel->buy(player->control(), player->view(), confirm);
}
return;