diff options
author | Stijn Buys <ingar@osirion.org> | 2010-09-19 22:49:55 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-09-19 22:49:55 +0000 |
commit | e8f7c4a06fce9e41fb23ffc42a566501a78210cb (patch) | |
tree | 3adf0b1f3eae778e9645450d0e51821142f7983b /src/game/base/game.cc | |
parent | cc18095cded14f5e7e3f049e47fca2224134b647 (diff) |
player can only sell cargo on bases that allow it, trademenu layout updates
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r-- | src/game/base/game.cc | 16 |
1 files changed, 12 insertions, 4 deletions
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(); } |