mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user