[commands] Fix JoystickButton.getAsBoolean (#4131)

This previously always returned false; the get method it inherited was not used in the getAsBoolean defined in the Trigger class. The fix is to swap get() and getAsBoolean() implementations in the Trigger class.
This commit is contained in:
ohowe
2022-04-08 22:20:23 -06:00
committed by GitHub
parent 1b26e2d5da
commit f27a1f9bfb
2 changed files with 12 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ public class Trigger implements BooleanSupplier {
* @return whether or not the trigger condition is active.
*/
public boolean get() {
return this.getAsBoolean();
return m_isActive.getAsBoolean();
}
/**
@@ -69,8 +69,8 @@ public class Trigger implements BooleanSupplier {
* @return whether or not the trigger condition is active.
*/
@Override
public boolean getAsBoolean() {
return m_isActive.getAsBoolean();
public final boolean getAsBoolean() {
return this.get();
}
/**