diff --git a/src/xswiftbus/traffic.cpp b/src/xswiftbus/traffic.cpp index 3185c2d6f..2f437e782 100644 --- a/src/xswiftbus/traffic.cpp +++ b/src/xswiftbus/traffic.cpp @@ -30,6 +30,8 @@ // clazy:excludeall=reserve-candidates +float XPMP_PrepListHook(float, float, int, void *); // defined in xplanemp2/src/Renderer.cpp + using namespace BlackMisc::Simulation::XPlane::QtFreeUtils; namespace XSwiftBus @@ -107,6 +109,9 @@ namespace XSwiftBus else { m_enabledMultiplayer = true; + + // we will call xplanemp's callback from within our own callback + XPLMUnregisterFlightLoopCallback(XPMP_PrepListHook, nullptr); } } @@ -819,6 +824,8 @@ namespace XSwiftBus m_updates.push_back({ plane->id, &plane->position, &plane->surfaces, &plane->surveillance }); } XPMPUpdatePlanes(m_updates.data(), sizeof(XPMPUpdate_t), m_updates.size()); + + XPMP_PrepListHook(0, 0, 0, nullptr); } void CTraffic::interpolateGear(Plane* plane) diff --git a/src/xswiftbus/xplanemp2 b/src/xswiftbus/xplanemp2 index 71b339f88..b1dd0c845 160000 --- a/src/xswiftbus/xplanemp2 +++ b/src/xswiftbus/xplanemp2 @@ -1 +1 @@ -Subproject commit 71b339f88c1f1675d9e71a0754e17d7d44afe65a +Subproject commit b1dd0c84581750a5258903f536ff94383347bd87