Menu

[RESOLVED] Throttles won't go all the way to zero when controlled thru keyboard

bbosen
2022-08-12
2022-09-12
  • bbosen

    bbosen - 2022-08-12

    Online testing has revealed a bug in throttle management for users without an analog throttle of the type in common use with joysticks and USB game controllers. Those people fly with a "mouse" to control ailevators and ailerons, and they rely on the keyboard's "[" and "]" (square bracket) keys to diminish and increase throttle settings, respectively. Unfortunately, after landing their aircraft, these people find it very very difficult to diminish their throttles all the way to zero, so they tend to inch constantly forward until they slip over the far edge of the runway and fall over the cliffs beyond.

     
  • bbosen

    bbosen - 2022-08-12

    This has been fixed and is undergoing alpha testing in upcoming release 8.83.

    To fix this bug, I enhanced main.cpp's "event_thrustDown()" function with new logic. Here is the enhanced version:

    void event_thrustDown ()
    {
    display ((char )"event_thrustDown(). 150807AG", LOG_MOST);
    if (!fplayer->active)
    {
    return;
    }
    fplayer->thrustDown ();
    fplayer->thrustDown ();
    ThrottleReference += 1000;
    if (!MouseControlFlag)
    { // Get here if user has an analog throttle
    if (ThrottleReference > -20)
    { // Don't let ThrottleReference get too extreme
    ThrottleReference = -20;
    }
    }
    else
    { // Keyboard keys are used for throttle
    display ((char )"Keyboard triggered event_thrustDown().", LOG_MOST);
    if (ThrottleReference > -1)
    { // Don't let ThrottleReference get too extreme
    ThrottleReference = -1;
    }
    }
    sound->play (SOUND_CLICK1, false);
    ThrottleSettings(ThrottleReference + 32768);
    } // end event_thrustDown()
    

    Those that compile LAC from source code can fix this bug right now by replacing the "event_thrustDown()" function of Lac08p79 with the improved code shown above.

     
  • bbosen

    bbosen - 2022-08-12

    That "event_thrustDown()" function can be found in "main.cpp". Search for this line of code, near the top of that little function, to find it:

    display ((char *)"event_thrustDown(). 150807AG", LOG_MOST);

     
  • bbosen

    bbosen - 2022-09-12

    Linux Air Combat Version 8.83 has completed beta testing and has been placed into production, and this throttle management bug is fixed therein. All subsequent versions will benefit accordingly.

     

Log in to post a comment.

MongoDB Logo MongoDB