Skip to content

Commit

Permalink
Quick and dirty fix for the recent bugs
Browse files Browse the repository at this point in the history
Should fix the duplicating ships, dissapearing space center, missing or misplaced RT connection lines in the map view and various other weird issues.
  • Loading branch information
madadam committed Jan 3, 2014
1 parent 731df1d commit 43c1696
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/RemoteTech2/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ public void FindPath(ISatellite start, IEnumerable<ISatellite> commandStations)

public IEnumerable<NetworkLink<ISatellite>> FindNeighbors(ISatellite s)
{
if (!s.Powered) return Enumerable.Empty<NetworkLink<ISatellite>>();
if (!s.Powered || !Graph.ContainsKey(s.Guid)) return Enumerable.Empty<NetworkLink<ISatellite>>();
return Graph[s.Guid].Where(l => l.Target.Powered);
}

private void UpdateGraph(ISatellite a)
{
if (!Graph.ContainsKey(a.Guid)) return;

var result = new List<NetworkLink<ISatellite>>();

foreach (ISatellite b in this)
Expand Down
4 changes: 2 additions & 2 deletions src/RemoteTech2/VesselSatellite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RemoteTech
public class VesselSatellite : ISatellite
{
public bool Visible {
get { return SignalProcessor.Visible; }
get { return SignalProcessor != null ? SignalProcessor.Visible : false; }
}

public String Name {
Expand Down Expand Up @@ -43,7 +43,7 @@ public ISignalProcessor SignalProcessor
get {
return RTUtil.CachePerFrame(ref mSignalProcessor, () =>
{
return SignalProcessors.FirstOrDefault(s => s.FlightComputer != null) ?? SignalProcessors[0];
return SignalProcessors.FirstOrDefault(s => s.FlightComputer != null) ?? SignalProcessors.FirstOrDefault();
});
}
}
Expand Down

0 comments on commit 43c1696

Please sign in to comment.