mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Fix RepeatCommand calling end() twice (#5261)
This commit is contained in:
@@ -39,7 +39,12 @@ bool RepeatCommand::IsFinished() {
|
||||
}
|
||||
|
||||
void RepeatCommand::End(bool interrupted) {
|
||||
m_command->End(interrupted);
|
||||
// Make sure we didn't already call end() (which would happen if the command
|
||||
// finished in the last call to our execute())
|
||||
if (!m_ended) {
|
||||
m_command->End(interrupted);
|
||||
m_ended = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool RepeatCommand::RunsWhenDisabled() const {
|
||||
|
||||
Reference in New Issue
Block a user