diff options
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r-- | src/game/base/ship.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index f2bd703..6aaba40 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -24,29 +24,30 @@ namespace game const float MIN_DELTA = 0.000001f; -Ship::Ship(core::Player *owner, ShipModel *shipmodel) : - core::EntityControlable(owner, ship_enttype), - PhysicsBody(this) +Ship::Ship(core::Player *owner, ShipModel *shipmodel) : core::EntityControlable(), PhysicsBody(this) { + entity_moduletypeid = ship_enttype; + set_modelname(shipmodel->modelname()); set_name(shipmodel->name()); set_info(shipmodel); - std::string str(aux::text_strip(owner->name())); - aux::to_label(str); - set_label(str); - - entity_moduletypeid = ship_enttype; - - get_color().assign(owner->color()); - get_color_second().assign(owner->color_second()); - ship_shipmodel = shipmodel; ship_jumpdrive = shipmodel->jumpdrive(); - ship_impulsedrive_timer = 0; ship_jumpdrive_timer = 0; ship_jumpdepart = 0; + + if (owner) { + set_owner(owner); + get_color().assign(owner->color()); + get_color_second().assign(owner->color_second()); + std::string str(aux::text_strip(owner->name())); + aux::to_label(str); + set_label(str); + } else { + set_label(shipmodel->label()); + } reset(); } |