diff options
| author | Ennio Barbaro <enniobarbaro@gmail.com> | 2015-07-02 23:14:45 +0200 | 
|---|---|---|
| committer | Ennio Barbaro <enniobarbaro@gmail.com> | 2015-07-02 23:14:45 +0200 | 
| commit | 67d5b4a3fe4ea89aed3a7a674958c043eb25079d (patch) | |
| tree | a98fab92b2a55df40b9c803d018659278286f7c7 /x-plane-plugin | |
| parent | 1e1e4d6bf51805c30feee39083a1ee79f09f8641 (diff) | |
Reinit the offsets when re-enabling the plugin
Diffstat (limited to 'x-plane-plugin')
| -rw-r--r-- | x-plane-plugin/plugin.c | 9 | 
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;  }  | 
