Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-10-09 22:05:46 +0000
committerStijn Buys <ingar@osirion.org>2010-10-09 22:05:46 +0000
commit43927cc52bdd7e44d62b0e6309612558f565b70f (patch)
treea3e9ccf69d6ab03c8444b78ac53d49529a52e675 /src/game
parent0ecdd8bc98ba583bbee801b838d785c6f881d7df (diff)
fix crash introduced with inventory transfer, buywindow credits indicator,
removed impulse drive initialization delay.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/ship.cc6
-rw-r--r--src/game/base/shipmodel.cc17
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";