LobbyUI fixes (#27033)
* LobbyUI fixes I have no idea which were bugs prior but anyway fix stuff. * More fixes * Test moment
This commit is contained in:
@@ -315,6 +315,7 @@ namespace Content.Shared.Preferences
|
||||
list.Remove(antagId);
|
||||
}
|
||||
}
|
||||
|
||||
return new(this, _jobPriorities, list, _traitPreferences, _loadouts);
|
||||
}
|
||||
|
||||
@@ -565,6 +566,23 @@ namespace Content.Shared.Preferences
|
||||
_loadouts[loadout.Role.Id] = loadout;
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithLoadout(RoleLoadout loadout)
|
||||
{
|
||||
// Deep copies so we don't modify the DB profile.
|
||||
var copied = new Dictionary<string, RoleLoadout>();
|
||||
|
||||
foreach (var proto in _loadouts)
|
||||
{
|
||||
if (proto.Key == loadout.Role)
|
||||
continue;
|
||||
|
||||
copied[proto.Key] = proto.Value.Clone();
|
||||
}
|
||||
|
||||
copied[loadout.Role] = loadout.Clone();
|
||||
return new(this, _jobPriorities, _antagPreferences, _traitPreferences, copied);
|
||||
}
|
||||
|
||||
public RoleLoadout GetLoadoutOrDefault(string id, IEntityManager entManager, IPrototypeManager protoManager)
|
||||
{
|
||||
if (!_loadouts.TryGetValue(id, out var loadout))
|
||||
|
||||
Reference in New Issue
Block a user