X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAITanker.cxx;h=6ab43e0349a16ca458e452f32dc6952e838f7a70;hb=3d4806adbe6705f785fd950bd4b4afde1cb4f8d2;hp=b123c4512edc7f74fdd355b3c7ecbd905e4310f5;hpb=c1e29d09981dfcd47ff213069fbe8fd5c8ccaf0c;p=flightgear.git diff --git a/src/AIModel/AITanker.cxx b/src/AIModel/AITanker.cxx index b123c4512..6ab43e034 100644 --- a/src/AIModel/AITanker.cxx +++ b/src/AIModel/AITanker.cxx @@ -35,22 +35,22 @@ void FGAITanker::readFromScenario(SGPropertyNode* scFileNode) { return; FGAIAircraft::readFromScenario(scFileNode); - setTACANChannelID(scFileNode->getStringValue("TACAN-channel-ID")); + setTACANChannelID(scFileNode->getStringValue("TACAN-channel-ID","")); + setName(scFileNode->getStringValue("name", "Tanker")); + } void FGAITanker::bind() { FGAIAircraft::bind(); - props->tie("refuel/contact", SGRawValuePointer(&contact)); + tie("refuel/contact", SGRawValuePointer(&contact)); + tie("position/altitude-agl-ft",SGRawValuePointer(&altitude_agl_ft)); + props->setStringValue("navaids/tacan/channel-ID", TACAN_channel_id.c_str()); + props->setStringValue("name", _name.c_str()); props->setBoolValue("tanker", true); } -void FGAITanker::unbind() { - FGAIAircraft::unbind(); - props->untie("refuel/contact"); -} - void FGAITanker::setTACANChannelID(const string& id) { TACAN_channel_id = id; } @@ -58,6 +58,9 @@ void FGAITanker::setTACANChannelID(const string& id) { void FGAITanker::Run(double dt) { //FGAIAircraft::Run(dt); + double start = pos.getElevationFt() + 1000; + altitude_agl_ft = _getAltitudeAGL(pos, start); + //###########################// // do calculations for radar // //###########################//