[commands] Test no-op behavior of scheduling a scheduled command (#4806)

This commit is contained in:
Starlight220
2022-12-13 06:29:47 +02:00
committed by GitHub
parent a865f48e96
commit 61c75deb2a
4 changed files with 32 additions and 5 deletions

View File

@@ -119,9 +119,8 @@ void CommandScheduler::Schedule(Command* command) {
RequireUngrouped(command);
if (m_impl->disabled ||
(frc::RobotState::IsDisabled() && !command->RunsWhenDisabled()) ||
m_impl->scheduledCommands.contains(command)) {
if (m_impl->disabled || m_impl->scheduledCommands.contains(command) ||
(frc::RobotState::IsDisabled() && !command->RunsWhenDisabled())) {
return;
}