TryGetData() Generics support content changes (#13053)
This commit is contained in:
parent
38a31db13f
commit
c7ec03d2fb
|
|
@ -219,8 +219,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
|||
|
||||
if (slot == "jumpsuit" && sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var suitLayer))
|
||||
{
|
||||
if (_appearance.TryGetData(equipee, HumanoidVisualizerKey.Key, out object? obj)
|
||||
&& obj is HumanoidVisualizerData data
|
||||
if (_appearance.TryGetData<HumanoidVisualizerData>(equipee, HumanoidVisualizerKey.Key, out var data)
|
||||
&& data.Sex == Sex.Female)
|
||||
{
|
||||
sprite.LayerSetState(suitLayer, clothingComponent.FemaleMask switch
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ public sealed class VendingMachineSystem : SharedVendingMachineSystem
|
|||
return;
|
||||
|
||||
if (!TryComp<AppearanceComponent>(uid, out var appearance) ||
|
||||
!_appearanceSystem.TryGetData(uid, VendingMachineVisuals.VisualState, out var visualStateObject, appearance) ||
|
||||
visualStateObject is not VendingMachineVisualState visualState)
|
||||
!_appearanceSystem.TryGetData<VendingMachineVisualState>(uid, VendingMachineVisuals.VisualState, out var visualState, appearance))
|
||||
{
|
||||
visualState = VendingMachineVisualState.Normal;
|
||||
}
|
||||
|
|
@ -147,7 +146,7 @@ public enum VendingMachineVisualLayers : byte
|
|||
Base,
|
||||
/// <summary>
|
||||
/// Normal / Deny / Eject
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
BaseUnshaded,
|
||||
/// <summary>
|
||||
/// Screens that are persistent (where the machine is not off or broken)
|
||||
|
|
|
|||
|
|
@ -10,12 +10,10 @@ public sealed class RandomArtifactSpriteSystem : VisualizerSystem<RandomArtifact
|
|||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (!AppearanceSystem.TryGetData(uid, SharedArtifactsVisuals.SpriteIndex, out var ind, args.Component)
|
||||
|| ind is not int spriteIndex)
|
||||
if (!AppearanceSystem.TryGetData<int>(uid, SharedArtifactsVisuals.SpriteIndex, out var spriteIndex, args.Component))
|
||||
return;
|
||||
|
||||
if (!AppearanceSystem.TryGetData(uid, SharedArtifactsVisuals.IsActivated, out var act, args.Component)
|
||||
|| act is not bool isActivated)
|
||||
if (!AppearanceSystem.TryGetData<bool>(uid, SharedArtifactsVisuals.IsActivated, out var isActivated, args.Component))
|
||||
isActivated = false;
|
||||
|
||||
var spriteIndexStr = spriteIndex.ToString("D2");
|
||||
|
|
|
|||
Loading…
Reference in New Issue