diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index 065698c..2e34b6e 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -1440,7 +1440,7 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo) std::string mAirportid = fgGetString("/instrumentation/comm/airport-id"); strncpy(PosMsg->airport, mAirportid.c_str(), 4); - PosMsg->airport[4 - 1] = '\0'; + //PosMsg->airport[4 - 1] = '\0'; float heading = ifce.get_Psi(); @@ -1452,27 +1452,32 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo) PosMsg->jwhtext[2] = XDR_encode_float (roll); SGPropertyNode* n = fgGetNode("/instrumentation/gps/indicated-ground-speed-kt",true); - float speed = n->getDoubleValue(); - PosMsg->jwhtext[3] = XDR_encode_float (speed); + float xxx = n->getDoubleValue(); + PosMsg->jwhtext[3] = XDR_encode_float (xxx); - /* - n = fgGetNode("/instrumentation/gps/indicated-vertical-speed"); + xxx = fgGetDouble("/instrumentation/gps/indicated-vertical-speed"); + PosMsg->jwhtext[4] = XDR_encode_float (xxx); - n = fgGetNode("/instrumentation/airspeed-indicator/indicated-speed-kt"); //指示空速 + xxx = fgGetDouble("/instrumentation/airspeed-indicator/indicated-speed-kt"); //指示空速 + PosMsg->jwhtext[5] = XDR_encode_float (xxx); - n = fgGetNode("/instrumentation/airspeed-indicator/true-speed-kt"); //真空速 + xxx = fgGetDouble("/instrumentation/airspeed-indicator/true-speed-kt"); //真空速 + PosMsg->jwhtext[6] = XDR_encode_float (xxx); - n = fgGetNode("/instrumentation/gps/indicated-longitude-deg"); + xxx = fgGetDouble("/instrumentation/gps/indicated-longitude-deg"); + PosMsg->jwhtext[7] = XDR_encode_float (xxx); - n = fgGetNode("/instrumentation/gps/indicated-latitude-deg"); + xxx = fgGetDouble("/instrumentation/gps/indicated-latitude-deg"); + PosMsg->jwhtext[8] = XDR_encode_float (xxx); - n = fgGetNode("/instrumentation/gps/indicated-altitude-ft"); - - n = fgGetNode("/instrumentation/comm/airport-id"); //起飞机场 - - n = fgGetNode("/instrumentation/comm/frequencies/selected-mhz"); //守护频点 + xxx = fgGetDouble("/instrumentation/gps/indicated-altitude-ft"); + PosMsg->jwhtext[9] = XDR_encode_float (xxx); + + xxx = fgGetDouble("/instrumentation/comm/frequencies/selected-mhz"); //守护频点 + PosMsg->jwhtext[10] = XDR_encode_float (xxx); - n = fgGetNode("/instrumentation/transponder/id-code"); + xxx = fgGetDouble("/instrumentation/transponder/id-code"); + PosMsg->jwhtext[11] = XDR_encode_float (xxx); //n = fgGetNode("");