Skip to content

fix: resolve null currentScenario in manual only setup#1402

Closed
AECohn wants to merge 2 commits intomainfrom
fix.manualNullScenario
Closed

fix: resolve null currentScenario in manual only setup#1402
AECohn wants to merge 2 commits intomainfrom
fix.manualNullScenario

Conversation

@AECohn
Copy link
Copy Markdown
Contributor

@AECohn AECohn commented Mar 20, 2026

Existing code hascurrentScenario as null if automaticRouting isn't used, breaking rendering

This pull request addresses an issue in the SetRoomCombinationScenario method to ensure that the current scenario is not set to null when starting in manual mode. The change improves reliability by initiating the scenario change without awaiting the returned task.

Scenario management improvement:

  • EssentialsRoomCombiner.cs: Updated SetRoomCombinationScenario to call ChangeScenario(scenario) without awaiting the task, preventing the current scenario from being null in manual mode.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a rendering break in manual-only room combiner setups by ensuring a current scenario is established even when automatic routing isn’t used.

Changes:

  • Updates SetRoomCombinationScenario to invoke scenario switching logic so CurrentScenario is not left null in manual mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 449 to 451
// Sets the scenario while disregarding the returned task. This prevents current scenario from being null when starting in manual mode.
_ = ChangeScenario(scenario);
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChangeScenario(scenario) is currently executed inside the foreach (var partitionState ...) loop. That means the scenario may be activated/deactivated after only the first partition state is applied (and the call is redundantly invoked on every iteration, even if subsequent calls no-op). Move the scenario change call outside the loop (after all partition states have been set) so activation happens once and only after the partitions reflect the requested scenario.

Suggested change
// Sets the scenario while disregarding the returned task. This prevents current scenario from being null when starting in manual mode.
_ = ChangeScenario(scenario);
}
}
// Sets the scenario while disregarding the returned task. This prevents current scenario from being null when starting in manual mode.
_ = ChangeScenario(scenario);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
Debug.LogMessage(LogEventLevel.Debug, this, "Unable to find partition with key: '{0}'", partitionState.PartitionKey);
}
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be trailing whitespace after the closing brace, which can create noisy diffs and formatting churn. Please remove the extra spaces.

Suggested change
}
}

Copilot uses AI. Check for mistakes.
@AECohn AECohn closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants