]> git.mxchange.org Git - flightgear.git/commitdiff
Enforce a sane minimum of 1000m for coverage, to avoid run-away object
authordavid <david>
Sat, 20 Jul 2002 18:41:17 +0000 (18:41 +0000)
committerdavid <david>
Sat, 20 Jul 2002 18:41:17 +0000 (18:41 +0000)
placement.

src/Objects/newmat.cxx

index d40c6ccd32a6ed9a341a1e3db8351f6fbe0d9a73..28f146ffea73d35b7854c379ba19898b8c25b398 100644 (file)
@@ -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 <SGPropertyNode_ptr> path_nodes = node->getChildren("path");
   for (int i = 0; i < path_nodes.size(); i++)