private void CleanGPS(long gpsId) { if (!GpsForIdentity.TryGetValue(gpsId, out var data)) { return; } var e = MyAPIGateway.Session?.GPS.GetGpsList(gpsId); if (e == null) { return; } lock (data) { foreach (var k in data) { IMyGps existing = null; foreach (var ex in e) { if (ex.Hash == k) { existing = ex; break; } } if (existing != null && existing.DiscardAt.HasValue) { MyAPIGateway.Session.GPS.RemoveGps(gpsId, existing.Hash); } } data.Clear(); } }
public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid) { SyncFlag = true; base.Init(objectBuilder, cubeGrid); PowerReceiver = new MyPowerReceiver( MyConsumerGroupEnum.Charging, true, BlockDefinition.RequiredPowerInput, ComputeRequiredPower); var jumpDriveBuilder = objectBuilder as MyObjectBuilder_JumpDrive; NeedsUpdate |= VRage.ModAPI.MyEntityUpdateEnum.BEFORE_NEXT_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_100TH_FRAME; m_storedPower = jumpDriveBuilder.StoredPower; if (m_storedPower >= BlockDefinition.PowerNeededForJump) { m_storedPower = BlockDefinition.PowerNeededForJump; } m_storedJumpTarget = jumpDriveBuilder.JumpTarget; if (jumpDriveBuilder.JumpTarget != null) { m_jumpTarget = MySession.Static.Gpss.GetGps(jumpDriveBuilder.JumpTarget.Value); } m_jumpDistanceRatio = jumpDriveBuilder.JumpRatio; m_isRecharging = jumpDriveBuilder.Recharging; PowerReceiver.Update(); UpdateEmissivity(); }
public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid) { SyncFlag = true; var sinkComp = new MyResourceSinkComponent(); sinkComp.Init( BlockDefinition.ResourceSinkGroup, BlockDefinition.RequiredPowerInput, ComputeRequiredPower); ResourceSink = sinkComp; base.Init(objectBuilder, cubeGrid); var ob = objectBuilder as MyObjectBuilder_JumpDrive; NeedsUpdate |= VRage.ModAPI.MyEntityUpdateEnum.BEFORE_NEXT_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_100TH_FRAME; m_storedPower.Value = Math.Min(ob.StoredPower, BlockDefinition.PowerNeededForJump); m_storedJumpTarget = ob.JumpTarget; if (ob.JumpTarget != null) { m_jumpTarget = MySession.Static.Gpss.GetGps(ob.JumpTarget.Value); } m_jumpDistanceRatio.Value = ob.JumpRatio; m_isRecharging.Value = ob.Recharging; SlimBlock.ComponentStack.IsFunctionalChanged += ComponentStack_IsFunctionalChanged; IsWorkingChanged += MyJumpDrive_IsWorkingChanged; ResourceSink.Update(); UpdateEmissivity(); }
private void SelectGps(List <MyTerminalControlListBoxItem> selection) { if (selection.Count > 0) { m_selectedGps = (IMyGps)selection[0].UserData; } }
private void ShowLocationOnHud(Vector3D position) { long id = MyAPIGateway.Session.Player.IdentityId; IMyGps mygps = MyAPIGateway.Session.GPS.Create("=", "", position, true, true); MyAPIGateway.Session.GPS.AddGps(id, mygps); }
private void SelectGps(List <MyGuiControlListbox.Item> selection) { if (selection.Count > 0) { m_selectedGps = (IMyGps)selection[0].UserData; RaisePropertiesChangedJumpDrive(); } }
public void AddLocalGPS(IMyGps GPS) { if (MyAPIGateway.Session.LocalHumanPlayer == null) { return; } AddedGPS.Add(GPS, Ticker); MyAPIGateway.Session.GPS.AddGps(MyAPIGateway.Session.LocalHumanPlayer.IdentityId, GPS); }
public override void UpdateOnceBeforeFrame() { base.UpdateOnceBeforeFrame(); if (m_storedJumpTarget != null) { m_jumpTarget = MySession.Static.Gpss.GetGps(m_storedJumpTarget.Value); } }
public void RemoveLocalGPS(IMyGps GPS) { if (MyAPIGateway.Session.LocalHumanPlayer == null) { return; } MyAPIGateway.Session.GPS.RemoveGps(MyAPIGateway.Session.LocalHumanPlayer.IdentityId, GPS); AddedGPS.Remove(GPS); }
public FoundGrid(IMyCubeGrid g) { grid = g; type = g.Physics == null ? "Station" : g.GridSizeEnum == MyCubeSize.Large ? "Large Ship" : "Small Ship"; owner = calculateOwner(); gpsValue = MyAPIGateway.Session.GPS.Create(ToString(), "", grid.GetPosition(), true); gpsID = gpsValue.Hash | ~(((long)gpsValue.Hash) << 32); }
void IMyGpsCollection.AddLocalGps(IMyGps gps) { var internalGps = (MyGps)gps; if (AddPlayerGps(MySession.Static.LocalPlayerId, ref internalGps) && gps.ShowOnHud) { MyHud.GpsMarkers.RegisterMarker(internalGps); } }
private void HighlightDestinationVector(Vector3D location) { IMyGps gpsx = MyAPIGateway.Session.GPS.Create("Destination", "drone destination", location + new Vector3D(10, 0, 0), true); IMyGps gpsy = MyAPIGateway.Session.GPS.Create("Destination", "drone destination", location + new Vector3D(0, 10, 0), true); IMyGps gpsz = MyAPIGateway.Session.GPS.Create("Destination", "drone destination", location + new Vector3D(0, 0, 10), true); MyAPIGateway.Session.GPS.AddLocalGps(gpsx); MyAPIGateway.Session.GPS.AddLocalGps(gpsy); MyAPIGateway.Session.GPS.AddLocalGps(gpsz); }
private void JumpToGPS() { if (this.gpsCombobox.GetItemsCount() == 0) { return; } JumpSelectorGui.lastSelectedGps = (int)this.gpsCombobox.GetSelectedKey(); IMyGps myGps = this.gpsList.Values[JumpSelectorGui.lastSelectedGps]; this.JumpSystem.RequestJump(myGps.Name, myGps.Coords, this.ControlledBy.OwnerId); }
void TargetChanged() { if (m_targetSync.Value.HasValue) { m_jumpTarget = MySession.Static.Gpss.GetGps(m_targetSync.Value.Value); } else { m_jumpTarget = null; } RaisePropertiesChangedJumpDrive(); }
public void DebugMarkAllTrackedTargets() { long id = MyAPIGateway.Session.Player.IdentityId; count = 0; Logger.Debug(targets.Count + ""); foreach (var obj in targets) { count++; IMyGps mygps = MyAPIGateway.Session.GPS.Create("X", "", obj.Key.GetPosition(), true, true); MyAPIGateway.Session.GPS.AddGps(id, mygps); } }
public static IMyGps AddGPSToPlayer(long IdentityId, BroadcastInfo broadcastInfo) { int sosCount = Util.CountPlayerSOSGPS(IdentityId, _ModConfig.SignalText); if (sosCount > _ModConfig.MaxSignals) { return(null); } IMyGps gridGPS = MyAPIGateway.Session.GPS.Create(_ModConfig.SignalText, $"{broadcastInfo.EntityId}", broadcastInfo.Location, true, true); gridGPS.GPSColor = Color.OrangeRed; gridGPS.DiscardAt = TimeSpan.FromSeconds(MyAPIGateway.Session.ElapsedPlayTime.TotalSeconds + (double)_ModConfig.GPSDiscardTime); MyAPIGateway.Session.GPS.AddGps(IdentityId, gridGPS); return(gridGPS); }
private void ShowPosition(PathNode currentNode, string name = null) { IMyGps gps = MyAPIGateway.Session.GPS.Create(name ?? currentNode.Position.ToString(), string.Empty, currentNode.Position + m_obstructingEntity.GetPosition(), true, true); gps.DiscardAt = TimeSpan.MinValue; //Log.DebugLog("Showing " + gps.Coords); MyAPIGateway.Utilities.TryInvokeOnGameThread(() => MyAPIGateway.Session.GPS.AddLocalGps(gps)); #if DEBUG m_shownPositions.Enqueue(gps); if (m_shownPositions.Count == 100) { IMyGps remove = m_shownPositions.Dequeue(); //Log.DebugLog("Removing " + remove.Coords); MyAPIGateway.Utilities.TryInvokeOnGameThread(() => MyAPIGateway.Session.GPS.RemoveLocalGps(remove)); } #endif }
public void DebugMarkTargetAndKeyPoint() { TargetDetails target = GetEnemyTarget(); if (target != null) { var targetBlock = target.GetBestHardPointTarget(Ship.GetPosition()); long id = MyAPIGateway.Session.Player.IdentityId; IMyGps mygps = MyAPIGateway.Session.GPS.Create("X", "", target.Ship.GetPosition(), true, true); MyAPIGateway.Session.GPS.AddGps(id, mygps); if (targetBlock != null) { IMyGps mygps2 = MyAPIGateway.Session.GPS.Create("X", "", targetBlock.GetPosition(), true, true); MyAPIGateway.Session.GPS.AddGps(id, mygps2); } } }
public static BroadcastError AddBroadcastInfo(BroadcastInfo broadcastInfo, bool broadcast = false) { HashSet <long> playersToNotify; BroadcastError err = PlayersWithinSafeRange(broadcastInfo.Location, out playersToNotify); if (err == BroadcastError.TooCloseToPlayers || err == BroadcastError.TooFarFromPlayers) { return(err); } else { err = ValidateBlockRequirements(broadcastInfo); if (err != BroadcastError.Ok) { return(err); } if (err == BroadcastError.Ok && broadcast == true) { foreach (long identityId in playersToNotify) { // If player near owned Antenna consider adding more detils to grid description and increasing range // e.g. Antenna Size (big/small), Est. Grid Power, Grid Name, Ship/Station IMyGps myGPS = AddGPSToPlayer(identityId, broadcastInfo); if (myGPS != null) { broadcastInfo.MyGps.Add(myGPS); } } BroadcastingGrids.Add(broadcastInfo); MyVisualScriptLogicProvider.SendChatMessage($"Broadcasting {BroadcastingGrids.Count} offending grids", "SERVER", 0, "Red"); } return(BroadcastError.Ok); } }
private void OnTargetRemoved() { m_jumpTarget = null; RaisePropertiesChangedJumpDrive(); }
private void OnTargetSelected(int gpsHash) { m_jumpTarget = MySession.Static.Gpss.GetGps(gpsHash); RaisePropertiesChangedJumpDrive(); }
public static bool FindEntitiesNamed(string entityName, bool findPlayers, bool findShips, bool findAsteroids, bool findPlanets, bool findGps, out IMyPlayer player, out IMyEntity entity, out IMyGps gps) { #region Find Exact name match first. var playerList = new List<IMyPlayer>(); var shipList = new HashSet<IMyEntity>(); var asteroidList = new List<IMyVoxelBase>(); var planetList = new List<IMyVoxelBase>(); var gpsList = new List<IMyGps>(); if (findPlayers) MyAPIGateway.Players.GetPlayers(playerList, p => entityName == null || p.DisplayName.Equals(entityName, StringComparison.InvariantCultureIgnoreCase)); if (findShips) shipList = FindShipsByName(entityName); if (findAsteroids) MyAPIGateway.Session.VoxelMaps.GetInstances(asteroidList, v => v is IMyVoxelMap && (entityName == null || v.StorageName.Equals(entityName, StringComparison.InvariantCultureIgnoreCase))); if (findPlanets) MyAPIGateway.Session.VoxelMaps.GetInstances(planetList, v => v is Sandbox.Game.Entities.MyPlanet && (entityName == null || v.StorageName.Equals(entityName, StringComparison.InvariantCultureIgnoreCase))); if (findGps) gpsList = MyAPIGateway.Session.GPS.GetGpsList(MyAPIGateway.Session.Player.IdentityId).Where(g => entityName == null || g.Name.Equals(entityName, StringComparison.InvariantCultureIgnoreCase)).ToList(); // identify a unique ship or player by the name. if (playerList.Count > 1 || shipList.Count > 1 || asteroidList.Count > 1 || planetList.Count > 1 || gpsList.Count > 1) { // TODO: too many entities. hotlist or sublist? string msg = "Too many entries with that name."; if (findPlayers) msg += string.Format(" Players: {0}", playerList.Count); if (findShips) msg += string.Format(" Ships: {0}", shipList.Count); if (findAsteroids) msg += string.Format(" Asteroids: {0}", asteroidList.Count); if (findPlayers) msg += string.Format(" Planets: {0}", planetList.Count); if (findGps) msg += string.Format(" Gps: {0}", gpsList.Count); MyAPIGateway.Utilities.ShowMessage("Cannot match", msg); player = null; entity = null; gps = null; return false; } if (playerList.Count == 1 && shipList.Count == 0 && asteroidList.Count == 0 && planetList.Count == 0 && gpsList.Count == 0) { player = playerList[0]; entity = null; gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 1 && asteroidList.Count == 0 && planetList.Count == 0 && gpsList.Count == 0) { player = null; entity = shipList.FirstElement(); gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 0 && asteroidList.Count == 1 && planetList.Count == 0 && gpsList.Count == 0) { player = null; entity = asteroidList[0]; gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 0 && asteroidList.Count == 0 && planetList.Count == 1 && gpsList.Count == 0) { player = null; entity = planetList[0]; gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 0 && asteroidList.Count == 0 && planetList.Count == 0 && gpsList.Count == 1) { player = null; entity = null; gps = gpsList[0]; return true; } #endregion #region find partial name matches. playerList.Clear(); shipList.Clear(); asteroidList.Clear(); planetList.Clear(); gpsList.Clear(); if (findPlayers) MyAPIGateway.Players.GetPlayers(playerList, p => entityName == null || p.DisplayName.IndexOf(entityName, StringComparison.InvariantCultureIgnoreCase) >= 0); if (findShips) shipList = FindShipsByName(entityName, true, false); if (findAsteroids) MyAPIGateway.Session.VoxelMaps.GetInstances(asteroidList, v => v is IMyVoxelMap && (entityName == null || v.StorageName.IndexOf(entityName, StringComparison.InvariantCultureIgnoreCase) >= 0)); if (findPlanets) MyAPIGateway.Session.VoxelMaps.GetInstances(planetList, v => v is Sandbox.Game.Entities.MyPlanet && (entityName == null || v.StorageName.IndexOf(entityName, StringComparison.InvariantCultureIgnoreCase) >= 0)); if (findGps) gpsList = MyAPIGateway.Session.GPS.GetGpsList(MyAPIGateway.Session.Player.IdentityId).Where(g => entityName == null || g.Name.IndexOf(entityName, StringComparison.InvariantCultureIgnoreCase) >= 0).ToList(); // identify a unique ship or player by the name. if (playerList.Count > 1 || shipList.Count > 1 || asteroidList.Count > 1 || planetList.Count > 1 || gpsList.Count > 1) { // TODO: too many entities. hotlist or sublist? string msg = "Too many entries with that name."; if (findPlayers) msg += string.Format(" Players: {0}", playerList.Count); if (findShips) msg += string.Format(" Ships: {0}", shipList.Count); if (findAsteroids) msg += string.Format(" Asteroids: {0}", asteroidList.Count); if (findPlayers) msg += string.Format(" Planets: {0}", planetList.Count); if (findGps) msg += string.Format(" Gps: {0}", gpsList.Count); MyAPIGateway.Utilities.ShowMessage("Cannot match", msg); player = null; entity = null; gps = null; return false; } if (playerList.Count == 1 && shipList.Count == 0 && asteroidList.Count == 0 && planetList.Count == 0 && gpsList.Count == 0) { player = playerList[0]; entity = null; gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 1 && asteroidList.Count == 0 && planetList.Count == 0 && gpsList.Count == 0) { player = null; entity = shipList.FirstElement(); gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 0 && asteroidList.Count == 1 && planetList.Count == 0 && gpsList.Count == 0) { player = null; entity = asteroidList[0]; gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 0 && asteroidList.Count == 0 && planetList.Count == 1 && gpsList.Count == 0) { player = null; entity = planetList[0]; gps = null; return true; } if (playerList.Count == 0 && shipList.Count == 0 && asteroidList.Count == 0 && planetList.Count == 0 && gpsList.Count == 1) { player = null; entity = null; gps = gpsList[0]; return true; } #endregion // In reality, this is equivilant to: // if (playerList.Count == 0 && shipList.Count == 0 && asteroidList.Count == 0 && planetList.Count == 0 && gpsList.Count == 0) MyAPIGateway.Utilities.ShowMessage("Error", "Could not find specified object"); player = null; entity = null; gps = null; return false; }
void IMyGpsCollection.RemoveLocalGps(IMyGps gps) { RemovePlayerGps(gps.Hash); }
public MyAutopilotWaypoint(IMyGps gps, MyRemoteControl owner) : this(gps.Coords, gps.Name, null, null, owner) { }
private void SelectGps(List<MyGuiControlListbox.Item> selection) { if (selection.Count > 0) { m_selectedGps = (IMyGps)selection[0].UserData; RaisePropertiesChangedJumpDrive(); } }
public override void UpdateBeforeSimulation100() { if (projector.Enabled) { var players = new List <IMyPlayer>(); Sandbox.ModAPI.MyAPIGateway.Players.GetPlayers(players); eventOwner = null; foreach (var player in players) { if (player.SteamUserId == EventOwnerId) { eventOwner_ID = player.IdentityId; break; } } double x = projector.GetPosition().GetDim(0); double y = projector.GetPosition().GetDim(1); double z = projector.GetPosition().GetDim(2); double up_x = projector.WorldMatrix.GetOrientation().Up.GetDim(0); double up_y = projector.WorldMatrix.GetOrientation().Up.GetDim(1); double up_z = projector.WorldMatrix.GetOrientation().Up.GetDim(2); Vector3D up = projector.WorldMatrix.GetOrientation().Up; Vector3D forward = projector.WorldMatrix.GetOrientation().Forward; double x_1 = 0; double y_1 = 100; double z_1 = 0; switch (projector.CustomData) { case "Spawner: MakeStatic": IMyCubeGrid ship_grid = projector.CubeGrid as IMyCubeGrid; if (ship_grid.IsStatic == false) { ship_grid.IsStatic = true; } break; case "Spawner: Kumari": SpawnPrefab("AZR Kumari", new Vector3(x + 800, y + 800, z + 800), eventOwner_ID, forward, up); break; case "Spawner: Scout": SpawnPrefab("Azari - AE Hunter", new Vector3(x + x_1, y + y_1, z + z_1), eventOwner_ID, forward, up); break; case "Spawner: Sector Beacon Scout": SpawnPrefab("Azari - AE Hunter", new Vector3(x + 200, y, z), eventOwner_ID, forward, up); SpawnPrefab("Azari - AE Hunter", new Vector3(x, y, z - 200), eventOwner_ID, forward, up); break; case "Spawner: Sector Beacon": SpawnPrefab("Azari - Sector Beacon", new Vector3(x + x_1, y + y_1, z + z_1), eventOwner_ID, forward, up); break; case "Spawner: Flares": SpawnPrefab("Azari - Flare", new Vector3(x + 130, y, z), eventOwner_ID, forward, up); SpawnPrefab("Azari - Flare2", new Vector3(x, y + 100, z), eventOwner_ID, forward, up); SpawnPrefab("Azari - Flare2", new Vector3(x, y, z + 120), eventOwner_ID, forward, up); SpawnPrefab("Azari - Flare", new Vector3(x - 110, y, z), eventOwner_ID, forward, up); SpawnPrefab("Azari - Flare", new Vector3(x, y - 100, z), eventOwner_ID, forward, up); SpawnPrefab("Azari - Flare2", new Vector3(x, y, z - 150), eventOwner_ID, forward, up); break; case "Spawner: gps": signalLocation = projector.GetPosition(); foreach (var player in players) { if (player.IsBot || player.Character == null) { continue; } MyVisualScriptLogicProvider.ShowNotification(">>> WARNING AZARIAN SIGNAL DETECTED <<<", 4000, "Red", player.IdentityId); gps = MyAPIGateway.Session.GPS.Create(">>> AZARIAN SIGNAL <<<", "WARNING: The SRS located a Azarian signal", signalLocation, true, true); MyAPIGateway.Session.GPS.AddGps(player.IdentityId, gps); } break; } (projector as Sandbox.ModAPI.Ingame.IMyProjector).RequestEnable(false); } }
void IMyGpsCollection.RemoveGps(long identityId, IMyGps gps) { SendDelete(identityId, (gps as MyGps).Hash); }
void IMyGpsCollection.AddLocalGps(IMyGps gps) { var internalGps = (MyGps)gps; AddPlayerGps(MySession.LocalPlayerId, ref internalGps); if (gps.ShowOnHud) MyHud.GpsMarkers.RegisterMarker(internalGps); }
void IMyGpsCollection.SetShowOnHud(long identityId, IMyGps gps, bool show) { SendChangeShowOnHud(identityId, (gps as MyGps).Hash, show); }
public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid) { SyncFlag = true; var sinkComp = new MyResourceSinkComponent(); sinkComp.Init( BlockDefinition.ResourceSinkGroup, BlockDefinition.RequiredPowerInput, ComputeRequiredPower); ResourceSink = sinkComp; base.Init(objectBuilder, cubeGrid); var ob = objectBuilder as MyObjectBuilder_JumpDrive; NeedsUpdate |= VRage.ModAPI.MyEntityUpdateEnum.BEFORE_NEXT_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_100TH_FRAME; m_storedPower.Value = Math.Min(ob.StoredPower,BlockDefinition.PowerNeededForJump); m_storedJumpTarget = ob.JumpTarget; if (ob.JumpTarget != null) { m_jumpTarget = MySession.Static.Gpss.GetGps(ob.JumpTarget.Value); } m_jumpDistanceRatio.Value = ob.JumpRatio; m_isRecharging.Value = ob.Recharging; SlimBlock.ComponentStack.IsFunctionalChanged += ComponentStack_IsFunctionalChanged; IsWorkingChanged += MyJumpDrive_IsWorkingChanged; ResourceSink.Update(); UpdateEmissivity(); }
void IMyGpsCollection.ModifyGps(long identityId, IMyGps gps) { var internalGps = (MyGps)gps; SendModifyGps(identityId, internalGps); }
void IMyGpsCollection.AddLocalGps(IMyGps gps) { var internalGps = (MyGps)gps; internalGps.IsLocal = true; if (AddPlayerGps(MySession.Static.LocalPlayerId, ref internalGps) && gps.ShowOnHud) MyHud.GpsMarkers.RegisterMarker(internalGps); }
void IMyGpsCollection.AddGps(long identityId, IMyGps gps) { var internalGps = (MyGps)gps; SendAddGps(identityId, ref internalGps); }
public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid) { SyncFlag = true; base.Init(objectBuilder, cubeGrid); PowerReceiver = new MyPowerReceiver( MyConsumerGroupEnum.Charging, true, BlockDefinition.RequiredPowerInput, ComputeRequiredPower); var jumpDriveBuilder = objectBuilder as MyObjectBuilder_JumpDrive; NeedsUpdate |= VRage.ModAPI.MyEntityUpdateEnum.BEFORE_NEXT_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_FRAME | VRage.ModAPI.MyEntityUpdateEnum.EACH_100TH_FRAME; m_storedPower = jumpDriveBuilder.StoredPower; if (m_storedPower >= BlockDefinition.PowerNeededForJump) { m_storedPower = BlockDefinition.PowerNeededForJump; } m_storedJumpTarget = jumpDriveBuilder.JumpTarget; if (jumpDriveBuilder.JumpTarget != null) { m_jumpTarget = MySession.Static.Gpss.GetGps(jumpDriveBuilder.JumpTarget.Value); } m_jumpDistanceRatio = jumpDriveBuilder.JumpRatio; m_isRecharging = jumpDriveBuilder.Recharging; SlimBlock.ComponentStack.IsFunctionalChanged += ComponentStack_IsFunctionalChanged; IsWorkingChanged += MyJumpDrive_IsWorkingChanged; PowerReceiver.Update(); UpdateEmissivity(); }