mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T709, also log model name (so we can see if a particular model causes a crash)
This commit is contained in:
committed by
Mat Sutcliffe
parent
2793502839
commit
55d0eb97d0
@@ -995,11 +995,13 @@ namespace XSwiftBus
|
||||
double lxMeters = 0, lyMeters = 0, lzMeters = 0; // normally init not needed, just to avoid any issues
|
||||
static const double kFtToMeters = 0.3048;
|
||||
|
||||
std::string modelName = "unknown";
|
||||
if (traffic->m_followPlaneViewCallsign == CTraffic::ownAircraftString())
|
||||
{
|
||||
lxMeters = traffic->m_ownAircraftPositionX.get();
|
||||
lyMeters = traffic->m_ownAircraftPositionY.get();
|
||||
lzMeters = traffic->m_ownAircraftPositionZ.get();
|
||||
modelName = CTraffic::ownAircraftString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1033,6 +1035,7 @@ namespace XSwiftBus
|
||||
return 0;
|
||||
}
|
||||
|
||||
modelName = plane->modelName;
|
||||
if (!isValidPosition(plane->position))
|
||||
{
|
||||
WARNING_LOG("Invalid follow aircraft position for " + plane->callsign);
|
||||
@@ -1043,7 +1046,7 @@ namespace XSwiftBus
|
||||
// avoid underflow of camera into ground
|
||||
if (plane->isOnGround)
|
||||
{
|
||||
if (traffic->m_deltaCameraPosition.dyMeters < 5) { traffic->m_deltaCameraPosition.dyMeters = 5; }
|
||||
if (traffic->m_deltaCameraPosition.dyMeters < 10) { traffic->m_deltaCameraPosition.dyMeters = 10; }
|
||||
}
|
||||
|
||||
XPLMWorldToLocal(plane->position.lat, plane->position.lon, plane->position.elevation * kFtToMeters, &lxMeters, &lyMeters, &lzMeters);
|
||||
@@ -1069,7 +1072,7 @@ namespace XSwiftBus
|
||||
if (DEBUG)
|
||||
{
|
||||
DEBUG_LOG("Camera: " + pos2String(cameraPosition));
|
||||
DEBUG_LOG("Follow aircraft " + traffic->m_followPlaneViewCallsign);
|
||||
DEBUG_LOG("Follow aircraft " + traffic->m_followPlaneViewCallsign + " " + modelName);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user