From 67d5b4a3fe4ea89aed3a7a674958c043eb25079d Mon Sep 17 00:00:00 2001 From: Ennio Barbaro Date: Thu, 2 Jul 2015 23:14:45 +0200 Subject: Reinit the offsets when re-enabling the plugin --- x-plane-plugin/plugin.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'x-plane-plugin') diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c index 1643fc9c..999f6e15 100644 --- a/x-plane-plugin/plugin.c +++ b/x-plane-plugin/plugin.c @@ -118,6 +118,10 @@ static int TrackToggleHandler( XPLMCommandRef inCommand, { //Enable XPLMRegisterFlightLoopCallback(write_head_position, -1.0, NULL); + + // Reinit the offsets when we re-enable the plugin + if ( !translation_disabled ) + reinit_offset(); } else { @@ -133,6 +137,11 @@ static int TranslationToggleHandler( XPLMCommandRef inCommand, void * inRefCon ) { translation_disabled = !translation_disabled; + if (!translation_disabled) + { + // Reinit the offsets when we re-enable the translations so that we can "move around" + reinit_offset(); + } return 0; } -- cgit v1.2.3