From e8f7c4a06fce9e41fb23ffc42a566501a78210cb Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 19 Sep 2010 22:49:55 +0000 Subject: player can only sell cargo on bases that allow it, trademenu layout updates --- src/game/base/game.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/game/base/game.cc') diff --git a/src/game/base/game.cc b/src/game/base/game.cc index 83d0be8..803657d 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -227,6 +227,10 @@ void Game::func_give(core::Player *player, const std::string &args) } Ship * ship = new Ship(player, shipmodel); + core::Entity *view = player->view(); + if (view && (view == player->control())) { + view = ship; + } // FIME move this into a method in the Ship class ship->set_zone(player->control()->zone()); @@ -235,12 +239,12 @@ void Game::func_give(core::Player *player, const std::string &args) ship->get_axis().assign(player->control()->axis()); ship->set_speed(player->control()->speed()); ship->set_thrust(player->control()->thrust()); + //target_thrust is protected + //ship->target_thrust = player->control()->target_thrust()); - if (player->view() == player->control()) { - player->set_view(ship); - } player->remove_asset(player->control()); player->set_control(ship); + player->set_view(view); player->sound("game/buy-ship"); @@ -983,7 +987,11 @@ bool Game::load_menus(core::Entity *entity, const std::string &menufilename) } else if (inifile.got_key_long("price", l)) { if (item) { item->set_price(l); - } + } + } else if (inifile.got_key_long("amount", l)) { + if (item) { + item->set_amount(l); + } } else { inifile.unkown_key(); } -- cgit v1.2.3