Clean up stale preferences data on load at the server.

This fixes further bugs with "nonexistant job selected in character preferences" like the client blowing up in the lobby.
This commit is contained in:
Pieter-Jan Briers
2020-12-20 16:13:45 +01:00
parent 91e2dd2276
commit 921f7ab642
2 changed files with 33 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ namespace Content.Shared.Preferences
return new(Name, Age, Sex, appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences);
}
public HumanoidCharacterProfile WithJobPriorities(IReadOnlyDictionary<string, JobPriority> jobPriorities)
public HumanoidCharacterProfile WithJobPriorities(IEnumerable<KeyValuePair<string, JobPriority>> jobPriorities)
{
return new(
Name,
@@ -138,7 +138,7 @@ namespace Content.Shared.Preferences
return new(Name, Age, Sex, Appearance, _jobPriorities, mode, _antagPreferences);
}
public HumanoidCharacterProfile WithAntagPreferences(IReadOnlyList<string> antagPreferences)
public HumanoidCharacterProfile WithAntagPreferences(IEnumerable<string> antagPreferences)
{
return new(
Name,