Permalink
Browse files

If a stargate is not found just return the furthest entity available.…

… (why the hell isn't a stargate found though?)

We only use closeststargate and closeststation in the traveler to determine if we are 'too damn close' to either of them as a matter of situational awareness
  • Loading branch information...
ISeeDEDPpl committed May 10, 2012
1 parent 2cafc73 commit b73fe07e7da70c4fcf327027d8915ff6d6f4091f
Showing with 2 additions and 2 deletions.
  1. +2 −2 Questor.Modules/Caching/Cache.cs
@@ -984,7 +984,7 @@ public IEnumerable<EntityCache> Stations
public EntityCache ClosestStation
{
- get { return _closeststation ?? (_closeststation = _stations.OrderBy(s => s.Distance).FirstOrDefault()); }
+ get { return _closeststation ?? (_closeststation = _stations.OrderBy(s => s.Distance).FirstOrDefault() ?? Entities.OrderByDescending(s => s.Distance).FirstOrDefault()); }
}
public EntityCache StationByName(string stationName)
@@ -1008,7 +1008,7 @@ public IEnumerable<EntityCache> Stargates
}
public EntityCache ClosestStargate
{
- get { return _closeststargate ?? (_closeststargate = _stargates.OrderBy(s => s.Distance).FirstOrDefault()); }
+ get { return _closeststargate ?? (_closeststargate = Entities.Where(e => e.GroupId == (int)Group.Stargate).ToList().OrderBy(s => s.Distance).FirstOrDefault() ?? Entities.OrderByDescending(s => s.Distance).FirstOrDefault()); }
}
public EntityCache StargateByName (string locationName)

0 comments on commit b73fe07

Please sign in to comment.