From: curt Date: Tue, 25 May 1999 11:54:21 +0000 (+0000) Subject: Whups, fixed a simple bug so you can now fly across the lon = +/-180 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=27403e2fef5afe9b1316dd48487a81d54c73cc84;p=simgear.git Whups, fixed a simple bug so you can now fly across the lon = +/-180 boundary without any problems. --- diff --git a/Lib/Bucket/newbucket.cxx b/Lib/Bucket/newbucket.cxx index ff3c7b42..bb6f8bb9 100644 --- a/Lib/Bucket/newbucket.cxx +++ b/Lib/Bucket/newbucket.cxx @@ -97,7 +97,14 @@ FGBucket fgBucketOffset( double dlon, double dlat, int dx, int dy ) { double span = bucket_span( clat ); // walk dx units in the lon direction - result.set_bucket( dlon + dx * span, clat ); + double tmp = dlon + dx * span; + while ( tmp < -180.0 ) { + tmp += 360.0; + } + while ( tmp >= 180.0 ) { + tmp -= 360.0; + } + result.set_bucket( tmp, clat ); return result; }