From: Torsten Dreyer Date: Mon, 27 Sep 2010 17:38:15 +0000 (+0200) Subject: tolerate NDV (no directional validation) in METAR X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9a28642a4e4ebd1223aaa68c5ba3d96460686122;p=simgear.git tolerate NDV (no directional validation) in METAR --- diff --git a/simgear/environment/metar.cxx b/simgear/environment/metar.cxx index 2f5280e6..3879bb7d 100644 --- a/simgear/environment/metar.cxx +++ b/simgear/environment/metar.cxx @@ -466,11 +466,13 @@ bool SGMetar::scanVisibility() int modifier = SGMetarVisibility::EQUALS; // \d{4}(N|NE|E|SE|S|SW|W|NW)? if (scanNumber(&m, &i, 4)) { - if (*m == 'E') + if( strncmp( m, "NDV",3 ) == 0 ) { + m+=3; // tolerate NDV (no directional validation) + } else if (*m == 'E') { m++, dir = 90; - else if (*m == 'W') + } else if (*m == 'W') { m++, dir = 270; - else if (*m == 'N') { + } else if (*m == 'N') { m++; if (*m == 'E') m++, dir = 45; @@ -486,7 +488,7 @@ bool SGMetar::scanVisibility() m++, dir = 225; else dir = 180; - } + } if (i == 0) i = 50, modifier = SGMetarVisibility::LESS_THAN; else if (i == 9999)