Fix nullability for ReadyProfiles in GamePreset
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Content.Server.GameTicking
|
||||
public virtual string ModeTitle => "Sandbox";
|
||||
public virtual string Description => "Secret!";
|
||||
public virtual bool DisallowLateJoin => false;
|
||||
public Dictionary<NetUserId, HumanoidCharacterProfile> readyProfiles;
|
||||
public Dictionary<NetUserId, HumanoidCharacterProfile> ReadyProfiles = new();
|
||||
|
||||
public virtual void OnGameStarted() { }
|
||||
|
||||
|
||||
@@ -69,11 +69,11 @@ namespace Content.Server.GameTicking.GamePresets
|
||||
|
||||
foreach (var player in list)
|
||||
{
|
||||
if (!readyProfiles.ContainsKey(player.UserId))
|
||||
if (!ReadyProfiles.ContainsKey(player.UserId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var profile = readyProfiles[player.UserId];
|
||||
var profile = ReadyProfiles[player.UserId];
|
||||
if (profile.AntagPreferences.Contains(_prototypeManager.Index<AntagPrototype>(TraitorID).Name))
|
||||
{
|
||||
prefList.Add(player);
|
||||
|
||||
@@ -73,11 +73,11 @@ namespace Content.Server.GameTicking.GamePresets
|
||||
|
||||
foreach (var player in list)
|
||||
{
|
||||
if (!readyProfiles.ContainsKey(player.UserId))
|
||||
if (!ReadyProfiles.ContainsKey(player.UserId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var profile = readyProfiles[player.UserId];
|
||||
var profile = ReadyProfiles[player.UserId];
|
||||
if (profile.AntagPreferences.Contains("Traitor"))
|
||||
{
|
||||
prefList.Add(player);
|
||||
|
||||
@@ -1049,7 +1049,7 @@ The current game mode is: [color=white]{0}[/color].
|
||||
private GamePreset MakeGamePreset(Dictionary<NetUserId, HumanoidCharacterProfile> readyProfiles)
|
||||
{
|
||||
var preset = _dynamicTypeFactory.CreateInstance<GamePreset>(_presetType ?? typeof(PresetSandbox));
|
||||
preset.readyProfiles = readyProfiles;
|
||||
preset.ReadyProfiles = readyProfiles;
|
||||
return preset;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user