Makes Eyepatches Flippable (#26277)
This commit is contained in:
@@ -33,32 +33,32 @@ public sealed class FoldableClothingSystem : EntitySystem
|
||||
|
||||
private void OnFolded(Entity<FoldableClothingComponent> ent, ref FoldedEvent args)
|
||||
{
|
||||
if (TryComp<ClothingComponent>(ent.Owner, out var clothingComp) &&
|
||||
TryComp<ItemComponent>(ent.Owner, out var itemComp))
|
||||
if (!TryComp<ClothingComponent>(ent.Owner, out var clothingComp) ||
|
||||
!TryComp<ItemComponent>(ent.Owner, out var itemComp))
|
||||
return;
|
||||
|
||||
if (args.IsFolded)
|
||||
{
|
||||
if (args.IsFolded)
|
||||
{
|
||||
if (ent.Comp.FoldedSlots.HasValue)
|
||||
_clothingSystem.SetSlots(ent.Owner, ent.Comp.FoldedSlots.Value, clothingComp);
|
||||
if (ent.Comp.FoldedSlots.HasValue)
|
||||
_clothingSystem.SetSlots(ent.Owner, ent.Comp.FoldedSlots.Value, clothingComp);
|
||||
|
||||
if (ent.Comp.FoldedEquippedPrefix != null)
|
||||
_clothingSystem.SetEquippedPrefix(ent.Owner, ent.Comp.FoldedEquippedPrefix, clothingComp);
|
||||
if (ent.Comp.FoldedEquippedPrefix != null)
|
||||
_clothingSystem.SetEquippedPrefix(ent.Owner, ent.Comp.FoldedEquippedPrefix, clothingComp);
|
||||
|
||||
if (ent.Comp.FoldedHeldPrefix != null)
|
||||
_itemSystem.SetHeldPrefix(ent.Owner, ent.Comp.FoldedHeldPrefix, false, itemComp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ent.Comp.UnfoldedSlots.HasValue)
|
||||
_clothingSystem.SetSlots(ent.Owner, ent.Comp.UnfoldedSlots.Value, clothingComp);
|
||||
if (ent.Comp.FoldedHeldPrefix != null)
|
||||
_itemSystem.SetHeldPrefix(ent.Owner, ent.Comp.FoldedHeldPrefix, false, itemComp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ent.Comp.UnfoldedSlots.HasValue)
|
||||
_clothingSystem.SetSlots(ent.Owner, ent.Comp.UnfoldedSlots.Value, clothingComp);
|
||||
|
||||
if (ent.Comp.FoldedEquippedPrefix != null)
|
||||
_clothingSystem.SetEquippedPrefix(ent.Owner, null, clothingComp);
|
||||
if (ent.Comp.FoldedEquippedPrefix != null)
|
||||
_clothingSystem.SetEquippedPrefix(ent.Owner, null, clothingComp);
|
||||
|
||||
if (ent.Comp.FoldedHeldPrefix != null)
|
||||
_itemSystem.SetHeldPrefix(ent.Owner, null, false, itemComp);
|
||||
if (ent.Comp.FoldedHeldPrefix != null)
|
||||
_itemSystem.SetHeldPrefix(ent.Owner, null, false, itemComp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user