diff options
Diffstat (limited to 'src/game/base')
-rw-r--r-- | src/game/base/ship.cc | 6 | ||||
-rw-r--r-- | src/game/base/shipmodel.cc | 17 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 696033c..a588122 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -416,11 +416,13 @@ void Ship::frame(float seconds) // clamp input values target_thrust = 0.0f; + target_afterburner = 0.0f; math::clamp(target_pitch, -1.0f, 1.0f); math::clamp(target_roll, -1.0f, 1.0f); math::clamp(target_direction, -1.0f, 1.0f); - math::clamp(target_afterburner, -1.0f, 1.0f); - + + actual_maxspeed = Game::g_impulsespeed->value(); + actual_acceleration = Game::g_impulseacceleration->value(); actual_turnspeed *= 0.5; } diff --git a/src/game/base/shipmodel.cc b/src/game/base/shipmodel.cc index 9133d28..077fd3e 100644 --- a/src/game/base/shipmodel.cc +++ b/src/game/base/shipmodel.cc @@ -235,13 +235,6 @@ void ShipModel::buy(core::EntityControlable *buyer, core::Entity *seller) player->send("^WCan not afford transaction!"); return; } - - player->add_credits(-price()); - - // player has only ship for now - if (player->control()) { - player->remove_asset(player->control()); - } Ship * ship = new Ship(player, this); ship->set_zone(seller->zone()); @@ -257,9 +250,17 @@ void ShipModel::buy(core::EntityControlable *buyer, core::Entity *seller) } ship->inventory()->set_dirty(); + // remove old ship + if (player->control()) { + player->remove_asset(player->control()); + } + + // set control to new ship player->set_control(ship); player->set_view(seller); - + + player->add_credits(-price()); + // send the ship purchased message std::stringstream msgstr; msgstr << "^BPurchased " << aux::article(name()) << " for " << price() << " credits"; |