From: david Date: Sat, 20 Jul 2002 18:41:17 +0000 (+0000) Subject: Enforce a sane minimum of 1000m for coverage, to avoid run-away object X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d6f9038a25448c86f618b25a3ed18a24903c43fe;p=flightgear.git Enforce a sane minimum of 1000m for coverage, to avoid run-away object placement. --- diff --git a/src/Objects/newmat.cxx b/src/Objects/newmat.cxx index d40c6ccd3..28f146ffe 100644 --- a/src/Objects/newmat.cxx +++ b/src/Objects/newmat.cxx @@ -98,9 +98,16 @@ local_file_exists( const string& path ) { FGNewMat::Object::Object (const SGPropertyNode * node, double range_m) : _models_loaded(false), - _coverage_m2(node->getDoubleValue("coverage-m2", 100000)), + _coverage_m2(node->getDoubleValue("coverage-m2", 1000000)), _range_m(range_m) { + // Sanity check + if (_coverage_m2 < 1000) { + SG_LOG(SG_INPUT, SG_ALERT, "Random object coverage " << _coverage_m2 + << " is too small, forcing, to 1000"); + _coverage_m2 = 1000; + } + // Note all the model paths vector path_nodes = node->getChildren("path"); for (int i = 0; i < path_nodes.size(); i++)