diff options
author | Stijn Buys <ingar@osirion.org> | 2012-04-22 19:50:50 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-04-22 19:50:50 +0000 |
commit | 130682a299e202c4a02521c05ab11054fc0ba6b3 (patch) | |
tree | b6ce7ee7a3dad492ddee1e62245d37e8da9ebecf /src/game/base/ship.cc | |
parent | 8f124fabdfd6761cefbcc2c4120ba325692f5d0b (diff) |
Load entity weapon slots,
prevent the game from crashing when launching after obtaining a ship through 'give' while docked.
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r-- | src/game/base/ship.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 9a6d02e..ba30d67 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -75,6 +75,11 @@ Ship::Ship(core::Player *owner, const ShipModel *shipmodel) : core::EntityContro add_inventory(); inventory()->set_capacity(ship_shipmodel->maxcargo()); } + + if (model()) { + add_slots(); + slots()->load(model()); + } // menus for docked players if (ship_shipmodel->dockable()) { @@ -354,8 +359,7 @@ void Ship::set_dock(core::Entity *dock) get_location().assign(dock->location()); get_axis().assign(dock->axis()); ship_dock = dock; - - + // if the dock is not owned by a player. set it as spawn set_state(core::Entity::Docked); const core::Player *owner = (dock->type() == core::Entity::Controlable ? static_cast<core::EntityControlable *>(dock)->owner() : 0 ); |