Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r--src/game/base/ship.cc39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index d234783..d426a0d 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -23,9 +23,6 @@ namespace game
{
const float MIN_DELTA = 0.000001f;
-const float impulse_delay = 3.0f; // 3 second delay before impulse kicks in
- // note: this delay must match the impulse drive sound set
-const float jump_delay = 5.0f; // 5 seconds delay before jump driv kicks in
Ship::Ship(core::Player *owner, ShipModel *shipmodel) : core::EntityControlable()
{
@@ -106,36 +103,6 @@ void Ship::reset()
EntityControlable::reset();
}
-// this is called if another shuo wants to dock this ship
-void Ship::dock(Entity *entity)
-{
- if (!flag_is_set(core::Entity::Dockable))
- return;
-
- if (entity->moduletype() != ship_enttype)
- return;
-
- Ship *other_ship = static_cast<Ship *>(entity);
-
- if (math::distance(location(), other_ship->location()) > radius() + other_ship->radius()) {
- if (other_ship->owner())
- other_ship->owner()->send("Target out of range");
- return;
- }
-
- other_ship->get_location().assign(location());
- other_ship->set_state(core::Entity::Docked);
-
- if (other_ship->owner() && other_ship->owner()->control() == other_ship) {
- other_ship->owner()->set_view(this);
- if (owner()) {
- other_ship->owner()->send("^BDocking at " + owner()->name() + "^B's " + name());
- } else {
- other_ship->owner()->send("^BDocking at " + name());
- }
- }
-}
-
void Ship::func_impulse()
{
if (entity_state == core::Entity::Impulse) {
@@ -163,7 +130,7 @@ void Ship::func_impulse()
return;
entity_state = core::Entity::ImpulseInitiate;
- entity_timer = impulse_delay;
+ entity_timer = impulse_timer_delay;
ship_impulsedrive_timer = core::server()->time();
}
@@ -180,7 +147,7 @@ void Ship::initiate_jump(JumpPoint *depart)
ship_jumpdepart = depart;
entity_state = core::Entity::JumpInitiate;
- entity_timer = jump_delay;
+ entity_timer = jump_timer_delay;
ship_jumpdrive_timer = core::server()->time();
set_dirty();
@@ -422,7 +389,7 @@ void Ship::frame(float seconds)
if (ship_jumpdepart->moduletype() == jumpgate_enttype) {
get_axis().assign(ship_jumpdepart->target()->axis());
get_location().assign(ship_jumpdepart->target()->location());
- //entity_location += entity_axis.forward() * radius();
+ get_location() += axis().forward() * (radius() + ship_jumpdepart->target()->radius());
} else {
get_location().assign(ship_jumpdepart->target()->location() + location() - ship_jumpdepart->location());
}