Fix a segfault related to water runways
This commit is contained in:
parent
ea0fd7d9dd
commit
a377f11dad
3 changed files with 30 additions and 18 deletions
|
@ -1065,6 +1065,10 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
|||
point_list taxisigns_nodes = calc_elevations( apt_surf, ts_nodes, 0.0 );
|
||||
|
||||
// calc water runway buoys elevations:
|
||||
point_list water_buoys_nodes;
|
||||
if ( waterrunways.size() > 0){
|
||||
if ( waterrunways[0]->HasBuoys() )
|
||||
{
|
||||
point_list buoy_nodes;
|
||||
buoy_nodes.clear();
|
||||
for ( i = 0; i < (int)waterrunways.size(); ++i )
|
||||
|
@ -1077,7 +1081,9 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
|||
buoy_nodes.push_back( tmp_nodes.get_pt( 0, j ) );
|
||||
}
|
||||
}
|
||||
point_list water_buoys_nodes = calc_elevations( apt_surf, buoy_nodes, 0.0 );
|
||||
water_buoys_nodes = calc_elevations( apt_surf, buoy_nodes, 0.0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add base skirt (to hide potential cracks)
|
||||
|
|
|
@ -114,7 +114,6 @@ TGPolygon WaterRunway::GetNodes()
|
|||
{
|
||||
TGPolygon buoy_nodes;
|
||||
buoy_nodes.erase();
|
||||
if (buoys == 1){ /*no point to calculate stuff we don't need*/
|
||||
|
||||
double heading, az2, length;
|
||||
// calculate runway heading and length
|
||||
|
@ -123,7 +122,6 @@ TGPolygon WaterRunway::GetNodes()
|
|||
// create a polygon for the 4 buoy points
|
||||
// TODO: The amount of points can be increased if needed (more buoys)
|
||||
buoy_nodes = gen_wgs84_area(Point3D( (lon[0] + lon[1]) / 2 , (lat[0] + lat[1]) / 2, 0), length, 0, 0, width, heading, 0, false);
|
||||
}
|
||||
return buoy_nodes;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,6 +163,14 @@ public:
|
|||
return ( Point3D( lon[1], lat[1], 0.0f ));
|
||||
}
|
||||
|
||||
bool HasBuoys()
|
||||
{
|
||||
if (buoys == 1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
double width;
|
||||
int buoys;
|
||||
char rwnum[2][16];
|
||||
|
|
Loading…
Add table
Reference in a new issue