bool UFlareSpacecraftNavigationSystem::DockAt(AFlareSpacecraft* TargetStation) { FLOGV("UFlareSpacecraftNavigationSystem::DockAt : '%s' docking at '%s'", *Spacecraft->GetParent()->GetImmatriculation().ToString(), *TargetStation->GetParent()->GetImmatriculation().ToString()); FFlareDockingInfo DockingInfo = TargetStation->GetDockingSystem()->RequestDock(Spacecraft, Spacecraft->GetActorLocation()); // Docking granted if (DockingInfo.Granted) { if (IsDocked()) { FLOG("UFlareSpacecraftNavigationSystem::DockAt : leaving current dock"); Undock(); } FLOG("UFlareSpacecraftNavigationSystem::DockAt : access granted"); PushCommandDock(DockingInfo); return true; } // Failed else { FLOG("UFlareSpacecraftNavigationSystem::DockAt : docking denied"); return false; } }
void Ship::SetDockedWith(SpaceStation *s, int port) { if (s) { m_dockedWith = s; m_dockedWithPort = port; m_wheelTransition = 0; m_wheelState = 1.0f; // hand position/state responsibility over to station m_dockedWith->SetDocked(this, port); onDock.emit(); } else { Undock(); } }
void Ship::SetDockedWith(SpaceStation *s, int port) { if (s) { m_dockedWith = s; m_dockedWithPort = port; m_wheelState = 1.0f; m_flightState = DOCKED; SetVelocity(vector3d(0,0,0)); SetAngVelocity(vector3d(0,0,0)); Disable(); ClearThrusterState(); m_dockedWith->SetDocked(this, port); onDock.emit(); } else { Undock(); } }