Don't use invalid defaults for loadouts (#28740)

* Don't use invalid defaults for loadouts

At the time it made more sense but now with species specific stuff it's better to have nothing.

* Loadout SetDefault only applies valid loadouts
This commit is contained in:
metalgearsloth
2024-06-15 16:53:42 +10:00
committed by GitHub
parent f0fbedd640
commit 8f12e90b90
11 changed files with 64 additions and 26 deletions

View File

@@ -690,15 +690,15 @@ namespace Content.Shared.Preferences
return profile;
}
public RoleLoadout GetLoadoutOrDefault(string id, ProtoId<SpeciesPrototype>? species, IEntityManager entManager, IPrototypeManager protoManager)
public RoleLoadout GetLoadoutOrDefault(string id, ICommonSession? session, ProtoId<SpeciesPrototype>? species, IEntityManager entManager, IPrototypeManager protoManager)
{
if (!_loadouts.TryGetValue(id, out var loadout))
{
loadout = new RoleLoadout(id);
loadout.SetDefault(protoManager, force: true);
loadout.SetDefault(this, session, protoManager, force: true);
}
loadout.SetDefault(protoManager);
loadout.SetDefault(this, session, protoManager);
return loadout;
}