mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
only respect release of secondary for hold once pressed
This commit is contained in:
parent
4fcccb5455
commit
ebd347fc15
1 changed files with 12 additions and 2 deletions
|
@ -1470,6 +1470,7 @@ function MyController(hand) {
|
||||||
this.grabbedOverlay = null;
|
this.grabbedOverlay = null;
|
||||||
this.isInitialGrab = false;
|
this.isInitialGrab = false;
|
||||||
this.shouldResetParentOnRelease = false;
|
this.shouldResetParentOnRelease = false;
|
||||||
|
this.preparingHoldRelease = false;
|
||||||
|
|
||||||
this.checkForStrayChildren();
|
this.checkForStrayChildren();
|
||||||
|
|
||||||
|
@ -2151,10 +2152,19 @@ function MyController(hand) {
|
||||||
|
|
||||||
if (this.state == STATE_HOLD) {
|
if (this.state == STATE_HOLD) {
|
||||||
|
|
||||||
if (this.secondaryReleased()) {
|
if (this.secondarySqueezed()) {
|
||||||
|
// this.secondaryReleased() will always be true when not depressed
|
||||||
|
// so we cannot simply rely on that for release - ensure that the
|
||||||
|
// trigger was first "prepared" by being pushed in before the release
|
||||||
|
this.preparingHoldRelease = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.preparingHoldRelease && this.secondaryReleased()) {
|
||||||
// we have an equipped object and the secondary trigger was released
|
// we have an equipped object and the secondary trigger was released
|
||||||
// short-circuit the other checks and release it
|
// short-circuit the other checks and release it
|
||||||
this.release()
|
this.preparingHoldRelease = false;
|
||||||
|
|
||||||
|
this.release();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue