Fix nullability for ReadyProfiles in GamePreset

This commit is contained in:
DrSmugleaf
2020-12-16 10:00:10 +01:00
parent c770c6b37e
commit 49e6db2b87
4 changed files with 6 additions and 6 deletions

View File

@@ -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() { }

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;
}