Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/entity.cc5
-rw-r--r--src/game/base/shipmodel.cc2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 1438466..2b37d95 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -748,6 +748,11 @@ EntityControlable::~EntityControlable()
{
if (entity_owner)
entity_owner->remove_asset(this);
+
+ if (entity_actioninterface) {
+ entity_zone->physics()->removeAction(entity_actioninterface);
+ delete entity_actioninterface;
+ }
}
void EntityControlable::set_owner(Player *owner)
diff --git a/src/game/base/shipmodel.cc b/src/game/base/shipmodel.cc
index 077fd3e..3630d11 100644
--- a/src/game/base/shipmodel.cc
+++ b/src/game/base/shipmodel.cc
@@ -242,6 +242,7 @@ void ShipModel::buy(core::EntityControlable *buyer, core::Entity *seller)
ship->set_state(core::Entity::Docked);
ship->get_axis().assign(seller->axis());
ship->get_axis().change_direction(180.0f);
+ ship->reset();
// transfer inventory
for (core::Inventory::Items::iterator it = player->control()->inventory()->items().begin();
@@ -266,6 +267,7 @@ void ShipModel::buy(core::EntityControlable *buyer, core::Entity *seller)
msgstr << "^BPurchased " << aux::article(name()) << " for " << price() << " credits";
player->send(msgstr.str());
player->sound("game/buy-ship");
+
}
}