summaryrefslogtreecommitdiffhomepage
path: root/x-plane-plugin/plugin.c
diff options
context:
space:
mode:
authorEnnio Barbaro <enniobarbaro@gmail.com>2015-07-02 23:14:45 +0200
committerEnnio Barbaro <enniobarbaro@gmail.com>2015-07-02 23:14:45 +0200
commit67d5b4a3fe4ea89aed3a7a674958c043eb25079d (patch)
treea98fab92b2a55df40b9c803d018659278286f7c7 /x-plane-plugin/plugin.c
parent1e1e4d6bf51805c30feee39083a1ee79f09f8641 (diff)
Reinit the offsets when re-enabling the plugin
Diffstat (limited to 'x-plane-plugin/plugin.c')
-rw-r--r--x-plane-plugin/plugin.c9
1 files changed, 9 insertions, 0 deletions
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;
}