Checks to avoid issues during the XPlane startup.

Those here are precautionary.
This commit is contained in:
Klaus Basan
2019-08-22 22:23:34 +02:00
committed by Mat Sutcliffe
parent 3ea8f9c24f
commit 713972ad7c
4 changed files with 25 additions and 6 deletions

View File

@@ -24,9 +24,9 @@ static XSwiftBus::CPlugin *g_plugin = nullptr;
PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)
{
#if APL
#ifdef APL
// https://developer.x-plane.com/2014/12/mac-plugin-developers-you-should-be-using-native-paths/
XPLMEnableFeature("XPLM_USE_NATIVE_PATHS",1);
XPLMEnableFeature("XPLM_USE_NATIVE_PATHS", 1);
#endif
INFO_LOG("XSwiftBus plugin starting");
@@ -58,6 +58,12 @@ PLUGIN_API void XPluginReceiveMessage(XPLMPluginID from, long msg, void *param)
{
if (from == XPLM_PLUGIN_XPLANE)
{
if (!g_plugin || !g_plugin->isRunning())
{
WARNING_LOG("Received message, but plugin NOT running");
return;
}
switch (msg)
{
case XPLM_MSG_PLANE_LOADED: