Skip to content

Commit

Permalink
Merge branch 'master' into erm.-shadowkin-fuckery
Browse files Browse the repository at this point in the history
  • Loading branch information
SixplyDev authored Jan 25, 2025
2 parents 440b9a1 + 3417f35 commit b4610aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Content.Server/Clothing/Systems/LoadoutSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ public sealed class LoadoutSystem : EntitySystem
[Dependency] private readonly ISerializationManager _serialization = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly ILogManager _log = default!;

private ISawmill _sawmill = default!;


public override void Initialize()
{
_sawmill = _log.GetSawmill("loadouts");

SubscribeLocalEvent<PlayerSpawnCompleteEvent>(OnPlayerSpawnComplete);
}

Expand Down Expand Up @@ -89,6 +94,16 @@ public void ApplyCharacterLoadout(

foreach (var loadout in allLoadouts)
{
if (loadout.Item1 == EntityUid.Invalid
|| !HasComp<MetaDataComponent>(loadout.Item1)
|| Deleted(loadout.Item1))
{
_sawmill.Warning($"Loadout {loadout.Item2.LoadoutName} failed to load properly, deleting.");
EntityManager.QueueDeleteEntity(loadout.Item1);

continue;
}

var loadoutProto = _protoMan.Index<LoadoutPrototype>(loadout.Item2.LoadoutName);
if (loadoutProto.CustomName && loadout.Item2.CustomName != null)
_meta.SetEntityName(loadout.Item1, loadout.Item2.CustomName);
Expand Down

0 comments on commit b4610aa

Please sign in to comment.