1
0
Fork 0

AutoTower: Remove obsolete warnings and code

This commit is contained in:
Richard Harrison 2021-10-18 18:11:46 +02:00
parent 380e647d6f
commit 533791d53a

View file

@ -334,7 +334,6 @@ void FGEnvironmentMgr::updateClosestAirport()
auto automaticTowerActive = fgGetBool("/sim/tower/auto-position", true); auto automaticTowerActive = fgGetBool("/sim/tower/auto-position", true);
SGGeod nearestTowerPosition; SGGeod nearestTowerPosition;
bool nearestTowerPositionValid = false; /* <nearestTowerPositionValid> is set but unused. */
std::string nearestIdent; std::string nearestIdent;
const SGGeod airportGeod; const SGGeod airportGeod;
double towerDistance = numeric_limits<double>::max(); double towerDistance = numeric_limits<double>::max();
@ -366,8 +365,6 @@ void FGEnvironmentMgr::updateClosestAirport()
} }
// //
nearestIdent = nearestAirport->ident(); nearestIdent = nearestAirport->ident();
nearestTowerPositionValid = true;
towerDistance = SGGeodesy::distanceM(nearestTowerPosition, pos); towerDistance = SGGeodesy::distanceM(nearestTowerPosition, pos);
// when the tower doesn't move we can clear these. // when the tower doesn't move we can clear these.
@ -380,12 +377,10 @@ void FGEnvironmentMgr::updateClosestAirport()
auto nctn = SGSharedPtr< NearestCarrierToNotification> (new NearestCarrierToNotification(pos)); auto nctn = SGSharedPtr< NearestCarrierToNotification> (new NearestCarrierToNotification(pos));
if (simgear::Emesary::ReceiptStatus::OK == simgear::Emesary::GlobalTransmitter::instance()->NotifyAll(nctn)) { if (simgear::Emesary::ReceiptStatus::OK == simgear::Emesary::GlobalTransmitter::instance()->NotifyAll(nctn)) {
if (nearestCarrier != nctn->GetCarrier()) { if (nearestCarrier != nctn->GetCarrier()) {
SG_LOG(SG_ENVIRONMENT, SG_INFO, "Nearest carrier " << nctn->GetCarrierIdent() << " at a distance of " << nctn->GetDistanceMeters());
nearestCarrier = nctn->GetCarrier(); nearestCarrier = nctn->GetCarrier();
fgSetString("/sim/airport/nearest-carrier", nctn->GetCarrierIdent()); fgSetString("/sim/airport/nearest-carrier", nctn->GetCarrierIdent());
} }
} else { } else {
SG_LOG(SG_ENVIRONMENT, SG_INFO, "No carriers found");
fgSetString("/sim/airport/nearest-carrier", ""); fgSetString("/sim/airport/nearest-carrier", "");
fgSetDouble("/sim/airport/nearest-carrier-latitude-deg", 0); fgSetDouble("/sim/airport/nearest-carrier-latitude-deg", 0);
fgSetDouble("/sim/airport/nearest-carrier-longitude-deg", 0); fgSetDouble("/sim/airport/nearest-carrier-longitude-deg", 0);
@ -397,7 +392,6 @@ void FGEnvironmentMgr::updateClosestAirport()
// figure out if the carrier's tower is closer // figure out if the carrier's tower is closer
if (nearestCarrier && (nctn->GetDistanceMeters() < towerDistance)) { if (nearestCarrier && (nctn->GetDistanceMeters() < towerDistance)) {
nearestIdent = nctn->GetCarrierIdent(); nearestIdent = nctn->GetCarrierIdent();
nearestTowerPositionValid = true;
// //
// these will be used to determine and update the tower position // these will be used to determine and update the tower position