//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
// add an entry to the list
-void FGRunwayList::add( const string id, const string rwy_no,
+void FGRunwayList::add( const string& id, const string& rwy_no,
const double longitude, const double latitude,
const double heading, const double length,
const double width,
const double displ_thresh1, const double displ_thresh2,
const double stopway1, const double stopway2,
- const string lighting_flags, const int surface_code,
- const string shoulder_code, const int marking_code,
+ const string& lighting_flags, const int surface_code,
+ const string& shoulder_code, const int marking_code,
const double smoothness, const bool dist_remaining )
{
FGRunway rwy;
// Return reverse rwy number
// eg 01 -> 19
// 03L -> 21R
-static string GetReverseRunwayNo(string rwyno) {
+static string GetReverseRunwayNo(string& rwyno) {
// cout << "Original rwyno = " << rwyNo << '\n';
+ // Helipads don't have a seperate number per end
+ if(rwyno.size() && (rwyno[0] == 'H' || rwyno[0] == 'h')) {
+ return rwyno;
+ }
+
// standardize input number
string tmp = rwyno.substr(1, 1);
if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (rwyno.size() == 1)) {
found_dir = 180.0;
}
- next( &tmp_r );
+ if (!next( &tmp_r ))
+ break;
}
// SG_LOG( SG_GENERAL, SG_INFO, "closest runway = " << r._rwy_no