Skip to content

Commit

Permalink
Merge pull request #56 from TwinFan/next
Browse files Browse the repository at this point in the history
v3.0.2 Two workarounds for Mac and Linux XP12
  • Loading branch information
TwinFan authored Dec 18, 2022
2 parents 50309d3 + bb6a871 commit 9dbc5a8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else()
endif()

project(XPMP2
VERSION 3.0.1
VERSION 3.0.2
DESCRIPTION "Multiplayer library for X-Plane 11 and 12")

# Provide compile macros from the above project version definition
Expand Down
4 changes: 2 additions & 2 deletions XPMP2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
);
XPMP2_VER_MAJOR = 3;
XPMP2_VER_MINOR = 0;
XPMP2_VER_PATCH = 0;
XPMP2_VER_PATCH = 2;
XPSDK_ROOT = lib/SDK;
};
name = Debug;
Expand Down Expand Up @@ -553,7 +553,7 @@
);
XPMP2_VER_MAJOR = 3;
XPMP2_VER_MINOR = 0;
XPMP2_VER_PATCH = 0;
XPMP2_VER_PATCH = 2;
XPSDK_ROOT = lib/SDK;
};
name = Release;
Expand Down
12 changes: 11 additions & 1 deletion src/AIMultiplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,17 +738,27 @@ int AIMultiControlPlaneCount(
// MARK: Control Functions
//

/// Resets all actual values of the AI/multiplayer dataRefs of one plane to something initial
/// @brief Resets all actual values of the AI/multiplayer dataRefs of one plane to something initial
/// @note There as pending bug, filed as XPD-13332, which affects this function with XP12 on Mac.
/// X-Plane 12 can freeze since b5 when clearing Multiplayer positions to zero.
/// @see https://forums.x-plane.org/index.php?/forums/topic/276319-xp12-on-mac-since-b5-freeze-upon-tcas-activation/
void AIMultiClearAIDataRefs (multiDataRefsTy& drM,
bool bDeactivateToZero)
{
// not ok dataRefs?
if (!drM) return;

#if APL
// Apple Workaround for XP12: Don't init position, otherwise may freeze
if (glob.verXPlane < 12000) {
#endif
// either a "far away" location or standard 0, which is, however, a valid location somewhere!
XPLMSetDataf(drM.X, bDeactivateToZero ? 0.0f : FAR_AWAY_VAL_GL);
XPLMSetDataf(drM.Y, bDeactivateToZero ? 0.0f : FAR_AWAY_VAL_GL);
XPLMSetDataf(drM.Z, bDeactivateToZero ? 0.0f : FAR_AWAY_VAL_GL);
#if APL
}
#endif

XPLMSetDataf(drM.v_x, 0.0f); // zero speed
XPLMSetDataf(drM.v_y, 0.0f);
Expand Down
4 changes: 3 additions & 1 deletion src/Sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,9 @@ void SoundUpdatesDone ()
}
catch (const FmodError& e) {
e.LogErr(); // log the error
SoundCleanup(); // in case of errors here disable the sound system
// We ignore one specific error, which has been reported on some Linux configurations
if (e.fmodRes != FMOD_ERR_INVALID_VECTOR)
SoundCleanup(); // in case of errors here disable the sound system
}
}

Expand Down

0 comments on commit 9dbc5a8

Please sign in to comment.