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:
parent
657f811548
commit
91d3229514
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue