From 7c5184592f429fabbab9819e4c005853c9c5db96 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 24 Apr 2023 22:18:09 +0100 Subject: [PATCH] Prevent special attack being triggered when throwing saber in JKA --- Projects/Android/jni/JKXR/VrInputDefault.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Projects/Android/jni/JKXR/VrInputDefault.cpp b/Projects/Android/jni/JKXR/VrInputDefault.cpp index d194091..3462932 100644 --- a/Projects/Android/jni/JKXR/VrInputDefault.cpp +++ b/Projects/Android/jni/JKXR/VrInputDefault.cpp @@ -550,14 +550,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, } bool triggered = vr.primaryVelocityTriggeredAttack || (vr.dualsabers && vr.secondaryVelocityTriggeredAttack); - if (fired != triggered) + if (fired != triggered && + //Don't trigger regular attack if the trigger is held down as this can cause a special attack to occur in JKA + !(pDominantTrackedRemoteNew->Buttons & xrButton_Trigger)) { ALOGV("**WEAPON EVENT** veocity triggered %s", triggered ? "+attack" : "-attack"); //normal attack is a punch with the left hand sendButtonAction("+attack", triggered); - fired = triggered; } + fired = triggered; } else if (vr.primaryVelocityTriggeredAttack || vr.secondaryVelocityTriggeredAttack) { //send a stop attack as we have an unfinished velocity attack vr.primaryVelocityTriggeredAttack = false;