Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ public void SetRoomCombinationScenario(string scenarioKey)
{
Debug.LogMessage(LogEventLevel.Debug, this, "Unable to find partition with key: '{0}'", partitionState.PartitionKey);
}
// 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.
}
else
Expand Down
Loading