sanhozay / PilotLog

Flight logging for Flightgear flight simulator
GNU General Public License v3.0
1 stars 0 forks source link

Grace period for accidental time warp #16

Open sanhozay opened 3 years ago

sanhozay commented 3 years ago

Allow a grace period on accidental time warp, in the same way as is already provided for pause.

sanhozay commented 2 years ago

This was the solution I proposed, which is not working:

setlistener("sim/speed-up", func(node) {
    if (int(node.getValue()) != 1) {
        # Allow accidental speed up, as long as it is reverted
        # within a short timeframe
        var t = maketimer(5, func {
            if (int(node.getValue()) != 1)
                invalidate("Simulation+speed+was+changed");
        });
        t.singleShot = 1;
        t.start();
    }
}, startup=0, runtime=0);