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:
parent
1f1c752316
commit
2f00f31935
1 changed files with 5 additions and 3 deletions
|
@ -137,9 +137,10 @@ _setlistener("/sim/signals/fdm-initialized",
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
setlistener("/sim/rendering/headshake/enabled", func(n) {
|
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;
|
running_compression = 1;
|
||||||
|
# start new timer now
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -149,9 +150,10 @@ _setlistener("/sim/signals/fdm-initialized",
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
setlistener("/sim/rendering/redout/enabled", func(n) {
|
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;
|
running_redout = 1;
|
||||||
|
# start new timer now
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -163,4 +165,4 @@ _setlistener("/sim/signals/fdm-initialized",
|
||||||
# Now we've set up the listeners (which will have triggered), run it.
|
# Now we've set up the listeners (which will have triggered), run it.
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue