[commands] Deprecate Command.schedule() (#7072)

It's only syntactic sugar over the CommandScheduler's schedule method and creates a footgun because it’s too obvious to try to use in incorrect places.

Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
Gold856
2025-07-02 16:46:59 -04:00
committed by GitHub
parent a3ce880334
commit 26771e38fb
42 changed files with 77 additions and 66 deletions

View File

@@ -277,7 +277,10 @@ CommandPtr final {
/**
* Schedules this command.
*
* @deprecated Use CommandScheduler::GetInstance().Schedule() instead
*/
[[deprecated("Use CommandScheduler::GetInstance().Schedule() instead.")]]
void Schedule() const&;
// Prevent calls on a temporary, as the returned pointer would be invalid