1
0
Fork 0

Catch large ground-cache requests.

In some testing, JSBsim sometimes passed extremely large values into
this function (larger than the radius of the earth). This causes
every tile on the planet to be scheduled if using the standard STG
terrain, effectively blocking startup.

This code allows us a chance to catch this case via logging, but does
not fix the underlying issues.
This commit is contained in:
James Turner 2017-09-04 22:47:58 +01:00
parent 657f811548
commit 91d3229514

View file

@ -319,6 +319,11 @@ bool
FGGroundCache::prepare_ground_cache(double startSimTime, double endSimTime, FGGroundCache::prepare_ground_cache(double startSimTime, double endSimTime,
const SGVec3d& pt, double rad) const SGVec3d& pt, double rad)
{ {
if (rad > 10000.0) {
SG_LOG(SG_FLIGHT, SG_DEV_WARN, "FGGroundCache::prepare_ground_cache passed an excessive radius");
rad = 10000.0;
}
#ifdef GROUNDCACHE_DEBUG #ifdef GROUNDCACHE_DEBUG
SGTimeStamp t0 = SGTimeStamp::now(); SGTimeStamp t0 = SGTimeStamp::now();
#endif #endif