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