When I add an AI aircraft, I do sometimes see the same aircraft removed right after. So if I add an aircraft (let`s say with id 10) it is reported as removed instantly.
Reading about the reality bubble I understand there might be situations when I cannot add an AI aircraft. However, from my tests it looks all very random. So being located at position x, sometimes I can add aircraft on an airport about 50NM away, sometimes I can`t. When I add such an aircraft and it fails (actually adding does not fail, but is is removed afterwards - no errors while adding), then try again - it works.
Any idea why this happens or what`s the logic behind it?
Reading about the reality bubble I understand there might be situations when I cannot add an AI aircraft. However, from my tests it looks all very random. So being located at position x, sometimes I can add aircraft on an airport about 50NM away, sometimes I can`t. When I add such an aircraft and it fails (actually adding does not fail, but is is removed afterwards - no errors while adding), then try again - it works.
Any idea why this happens or what`s the logic behind it?
Code:
case SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE:
{
const SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE *event = static_cast<SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE *>(pData);
const DWORD objectID = event->dwData;
const SIMCONNECT_SIMOBJECT_TYPE objectType = event->eObjType;
if (objectType != SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT && objectType != SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER)
{
break;
}
// such an object is not necessarily one of ours
// for instance, I always see object 5 when I start the simulator
if (!simulatorFsx->getSimConnectObjects().isKnownSimObjectId(objectID)) break;
switch (event->uEventID)
{
case SystemEventObjectAdded:
// added in SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID
break;
case SystemEventObjectRemoved:
simulatorFsx->simulatorReportedObjectRemoved(objectID);
break;
default:
break;
}
break;
}
