1
0
Fork 0

Make sure only one g-force/redout handler instance is running

Enabling redout/compression separately started two handlers - instead of one.
This commit is contained in:
ThorstenB 2011-04-02 11:46:04 +02:00
parent 1f1c752316
commit 2f00f31935

View file

@ -137,9 +137,10 @@ _setlistener("/sim/signals/fdm-initialized",
}, 1);
setlistener("/sim/rendering/headshake/enabled", func(n) {
if ((running_compression == 0) and n.getBoolValue())
if ((running_compression == 0) and (running_redout == 0) and n.getBoolValue())
{
running_compression = 1;
# start new timer now
run();
}
else
@ -149,9 +150,10 @@ _setlistener("/sim/signals/fdm-initialized",
}, 1);
setlistener("/sim/rendering/redout/enabled", func(n) {
if ((running_redout == 0) and n.getBoolValue())
if ((running_compression == 0) and (running_redout == 0) and n.getBoolValue())
{
running_redout = 1;
# start new timer now
run();
}
else
@ -163,4 +165,4 @@ _setlistener("/sim/signals/fdm-initialized",
# Now we've set up the listeners (which will have triggered), run it.
run();
}
);
);