From 35107f7c2b14df5cf2a9950ff20de8cb9c89c294 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Thu, 24 Aug 2023 03:10:55 -0700 Subject: [PATCH] Fix component generic usages where IComponent would not be valid (#19482) --- .../ContextMenu/UI/EntityMenuPresenterGrouping.cs | 4 ++-- .../Instruments/UI/InstrumentBoundUserInterface.cs | 2 +- .../Radiation/Overlays/RadiationPulseOverlay.cs | 2 +- .../Administration/Commands/SetOutfitCommand.cs | 6 +++--- .../Administration/Systems/AdminVerbSystem.Antags.cs | 2 +- .../Administration/Systems/AdminVerbSystem.Smites.cs | 2 +- .../Administration/Systems/AdminVerbSystem.Tools.cs | 2 +- Content.Server/Administration/Systems/AdminVerbSystem.cs | 8 ++++---- Content.Server/Alert/Click/BreakVow.cs | 2 +- Content.Server/Alert/Click/RetakeVow.cs | 2 +- Content.Server/Alert/Click/StopBeingPulled.cs | 2 +- Content.Server/Ame/EntitySystems/AmeControllerSystem.cs | 2 +- Content.Server/Animals/Systems/UdderSystem.cs | 2 +- .../Chemistry/EntitySystems/ChemistrySystem.Injector.cs | 4 ++-- .../Chemistry/EntitySystems/SolutionTransferSystem.cs | 2 +- .../Construction/Conditions/MachineFrameComplete.cs | 2 +- .../Damage/Systems/DamageOnToolInteractSystem.cs | 4 ++-- .../Engineering/EntitySystems/SpawnAfterInteractSystem.cs | 2 +- Content.Server/Light/EntitySystems/MatchboxSystem.cs | 2 +- Content.Server/Morgue/MorgueSystem.cs | 2 +- Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs | 2 +- .../Power/Components/BaseNetConnectorComponent.cs | 2 +- Content.Server/Prayer/PrayerSystem.cs | 2 +- Content.Server/Sandbox/Commands/ColorNetworkCommand.cs | 2 +- Content.Server/Tabletop/TabletopSystem.Session.cs | 2 +- Content.Server/Tabletop/TabletopSystem.cs | 2 +- .../Pulling/Systems/SharedPullingSystem.Actions.cs | 8 ++++---- 27 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs b/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs index 057bdd6026..d8804a1218 100644 --- a/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs +++ b/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs @@ -35,8 +35,8 @@ namespace Content.Client.ContextMenu.UI (a, b, entMan) => entMan.GetComponent(a).EntityPrototype!.ID == entMan.GetComponent(b).EntityPrototype!.ID, (a, b, entMan) => { - entMan.TryGetComponent(a, out var spriteA); - entMan.TryGetComponent(b, out var spriteB); + entMan.TryGetComponent(a, out SpriteComponent? spriteA); + entMan.TryGetComponent(b, out SpriteComponent? spriteB); if (spriteA == null || spriteB == null) return spriteA == spriteB; diff --git a/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs b/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs index 23611c3fda..d88eb94130 100644 --- a/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs +++ b/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs @@ -49,7 +49,7 @@ namespace Content.Client.Instruments.UI protected override void Open() { - if (!EntMan.TryGetComponent(Owner, out var instrument)) + if (!EntMan.TryGetComponent(Owner, out InstrumentComponent? instrument)) return; Instrument = instrument; diff --git a/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs b/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs index a07d4f6a74..d9b3ac48a4 100644 --- a/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs +++ b/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs @@ -107,7 +107,7 @@ namespace Content.Client.Radiation.Overlays { if (_entityManager.EntityExists(pulseEntity) && PulseQualifies(pulseEntity, currentEyeLoc) && - _entityManager.TryGetComponent(pulseEntity, out var pulse)) + _entityManager.TryGetComponent(pulseEntity, out RadiationPulseComponent? pulse)) { var shaderInstance = _pulses[pulseEntity]; shaderInstance.instance.CurrentMapCoords = _entityManager.GetComponent(pulseEntity).MapPosition; diff --git a/Content.Server/Administration/Commands/SetOutfitCommand.cs b/Content.Server/Administration/Commands/SetOutfitCommand.cs index 6fbc282bb9..5e2b0bd491 100644 --- a/Content.Server/Administration/Commands/SetOutfitCommand.cs +++ b/Content.Server/Administration/Commands/SetOutfitCommand.cs @@ -76,7 +76,7 @@ namespace Content.Server.Administration.Commands public static bool SetOutfit(EntityUid target, string gear, IEntityManager entityManager, Action? onEquipped = null) { - if (!entityManager.TryGetComponent(target, out var inventoryComponent)) + if (!entityManager.TryGetComponent(target, out InventoryComponent? inventoryComponent)) return false; var prototypeManager = IoCManager.Resolve(); @@ -85,7 +85,7 @@ namespace Content.Server.Administration.Commands HumanoidCharacterProfile? profile = null; // Check if we are setting the outfit of a player to respect the preferences - if (entityManager.TryGetComponent(target, out var actorComponent)) + if (entityManager.TryGetComponent(target, out ActorComponent? actorComponent)) { var userId = actorComponent.PlayerSession.UserId; var preferencesManager = IoCManager.Resolve(); @@ -106,7 +106,7 @@ namespace Content.Server.Administration.Commands } var equipmentEntity = entityManager.SpawnEntity(gearStr, entityManager.GetComponent(target).Coordinates); if (slot.Name == "id" && - entityManager.TryGetComponent(equipmentEntity, out var pdaComponent) && + entityManager.TryGetComponent(equipmentEntity, out PdaComponent? pdaComponent) && entityManager.TryGetComponent(pdaComponent.ContainedId, out var id)) { id.FullName = entityManager.GetComponent(target).EntityName; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs index 2c668c353c..f29035340e 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs @@ -19,7 +19,7 @@ public sealed partial class AdminVerbSystem // All antag verbs have names so invokeverb works. private void AddAntagVerbs(GetVerbsEvent args) { - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; var player = actor.PlayerSession; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index edd8b85dc5..45c754eba4 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -80,7 +80,7 @@ public sealed partial class AdminVerbSystem // All smite verbs have names so invokeverb works. private void AddSmiteVerbs(GetVerbsEvent args) { - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; var player = actor.PlayerSession; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs index e1266b14bb..b52e56009d 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs @@ -57,7 +57,7 @@ public sealed partial class AdminVerbSystem private void AddTricksVerbs(GetVerbsEvent args) { - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; var player = actor.PlayerSession; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.cs b/Content.Server/Administration/Systems/AdminVerbSystem.cs index d5f5602263..030c1faafa 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.cs @@ -79,7 +79,7 @@ namespace Content.Server.Administration.Systems private void AddAdminVerbs(GetVerbsEvent args) { - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; var player = actor.PlayerSession; @@ -215,7 +215,7 @@ namespace Content.Server.Administration.Systems private void AddDebugVerbs(GetVerbsEvent args) { - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; var player = actor.PlayerSession; @@ -349,7 +349,7 @@ namespace Content.Server.Administration.Systems // Get Disposal tube direction verb if (_groupController.CanCommand(player, "tubeconnections") && - EntityManager.TryGetComponent(args.Target, out var tube)) + EntityManager.TryGetComponent(args.Target, out DisposalTubeComponent? tube)) { Verb verb = new() { @@ -376,7 +376,7 @@ namespace Content.Server.Administration.Systems } if (_groupController.CanAdminMenu(player) && - EntityManager.TryGetComponent(args.Target, out var config)) + EntityManager.TryGetComponent(args.Target, out ConfigurationComponent? config)) { Verb verb = new() { diff --git a/Content.Server/Alert/Click/BreakVow.cs b/Content.Server/Alert/Click/BreakVow.cs index 93cf42726a..400dabbb01 100644 --- a/Content.Server/Alert/Click/BreakVow.cs +++ b/Content.Server/Alert/Click/BreakVow.cs @@ -13,7 +13,7 @@ namespace Content.Server.Alert.Click { var entManager = IoCManager.Resolve(); - if (entManager.TryGetComponent(player, out var mimePowers)) + if (entManager.TryGetComponent(player, out MimePowersComponent? mimePowers)) { entManager.System().BreakVow(player, mimePowers); } diff --git a/Content.Server/Alert/Click/RetakeVow.cs b/Content.Server/Alert/Click/RetakeVow.cs index e3787180d5..1b7a15ea74 100644 --- a/Content.Server/Alert/Click/RetakeVow.cs +++ b/Content.Server/Alert/Click/RetakeVow.cs @@ -13,7 +13,7 @@ namespace Content.Server.Alert.Click { var entManager = IoCManager.Resolve(); - if (entManager.TryGetComponent(player, out var mimePowers)) + if (entManager.TryGetComponent(player, out MimePowersComponent? mimePowers)) { entManager.System().RetakeVow(player, mimePowers); } diff --git a/Content.Server/Alert/Click/StopBeingPulled.cs b/Content.Server/Alert/Click/StopBeingPulled.cs index 5ea3e29e3e..2cf076fbee 100644 --- a/Content.Server/Alert/Click/StopBeingPulled.cs +++ b/Content.Server/Alert/Click/StopBeingPulled.cs @@ -20,7 +20,7 @@ namespace Content.Server.Alert.Click if (!entityManager.System().CanInteract(player, null)) return; - if (entityManager.TryGetComponent(player, out var playerPullable)) + if (entityManager.TryGetComponent(player, out SharedPullableComponent? playerPullable)) { entityManager.System().TryStopPull(playerPullable); } diff --git a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs index 3b427f65f4..f1dfa66d49 100644 --- a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs +++ b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs @@ -242,7 +242,7 @@ public sealed class AmeControllerSystem : EntitySystem return; } - if (!HasComp(args.Used)) + if (!HasComp(args.Used)) { _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-fail"), uid, args.User); return; diff --git a/Content.Server/Animals/Systems/UdderSystem.cs b/Content.Server/Animals/Systems/UdderSystem.cs index ce4d1762ba..ecbb4210d7 100644 --- a/Content.Server/Animals/Systems/UdderSystem.cs +++ b/Content.Server/Animals/Systems/UdderSystem.cs @@ -43,7 +43,7 @@ namespace Content.Server.Animals.Systems udder.AccumulatedFrameTime -= udder.UpdateRate; // Actually there is food digestion so no problem with instant reagent generation "OnFeed" - if (EntityManager.TryGetComponent(udder.Owner, out var hunger)) + if (EntityManager.TryGetComponent(udder.Owner, out HungerComponent? hunger)) { // Is there enough nutrition to produce reagent? if (_hunger.GetHungerThreshold(hunger) < HungerThreshold.Peckish) diff --git a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs index 6ac7f7f0d6..f3bac645d7 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs @@ -42,7 +42,7 @@ public sealed partial class ChemistrySystem if (!args.CanAccess || !args.CanInteract || args.Hands == null) return; - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; // Add specific transfer verbs according to the container's size @@ -312,7 +312,7 @@ public sealed partial class ChemistrySystem // Move units from attackSolution to targetSolution Solution removedSolution; - if (TryComp(targetEntity, out var stack)) + if (TryComp(targetEntity, out var stack)) removedSolution = _solutions.SplitStackSolution(injector, solution, realTransferAmount, stack.Count); else removedSolution = _solutions.SplitSolution(injector, solution, realTransferAmount); diff --git a/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs index 0f587e9294..893834f176 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs @@ -48,7 +48,7 @@ namespace Content.Server.Chemistry.EntitySystems if (!args.CanAccess || !args.CanInteract || !component.CanChangeTransferAmount || args.Hands == null) return; - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; // Custom transfer verb diff --git a/Content.Server/Construction/Conditions/MachineFrameComplete.cs b/Content.Server/Construction/Conditions/MachineFrameComplete.cs index bb87676021..9fa4098ec2 100644 --- a/Content.Server/Construction/Conditions/MachineFrameComplete.cs +++ b/Content.Server/Construction/Conditions/MachineFrameComplete.cs @@ -34,7 +34,7 @@ namespace Content.Server.Construction.Conditions var entityManager = IoCManager.Resolve(); - if (!entityManager.TryGetComponent(entity, out var machineFrame)) + if (!entityManager.TryGetComponent(entity, out MachineFrameComponent? machineFrame)) return false; if (!machineFrame.HasBoard) diff --git a/Content.Server/Damage/Systems/DamageOnToolInteractSystem.cs b/Content.Server/Damage/Systems/DamageOnToolInteractSystem.cs index db9335302f..2abd6fdf86 100644 --- a/Content.Server/Damage/Systems/DamageOnToolInteractSystem.cs +++ b/Content.Server/Damage/Systems/DamageOnToolInteractSystem.cs @@ -26,7 +26,7 @@ namespace Content.Server.Damage.Systems return; if (component.WeldingDamage is {} weldingDamage - && EntityManager.TryGetComponent(args.Used, out var welder) + && EntityManager.TryGetComponent(args.Used, out WelderComponent? welder) && welder.Lit && !welder.TankSafe) { @@ -39,7 +39,7 @@ namespace Content.Server.Damage.Systems args.Handled = true; } else if (component.DefaultDamage is {} damage - && EntityManager.TryGetComponent(args.Used, out var tool) + && EntityManager.TryGetComponent(args.Used, out ToolComponent? tool) && tool.Qualities.ContainsAny(component.Tools)) { var dmg = _damageableSystem.TryChangeDamage(args.Target, damage, origin: args.User); diff --git a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs index 696db2ec3a..2367789b99 100644 --- a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs +++ b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs @@ -58,7 +58,7 @@ namespace Content.Server.Engineering.EntitySystems if (component.Deleted || !IsTileClear()) return; - if (EntityManager.TryGetComponent(component.Owner, out var stackComp) + if (EntityManager.TryGetComponent(component.Owner, out StackComponent? stackComp) && component.RemoveOnInteract && !_stackSystem.Use(uid, 1, stackComp)) { return; diff --git a/Content.Server/Light/EntitySystems/MatchboxSystem.cs b/Content.Server/Light/EntitySystems/MatchboxSystem.cs index b4c6f28ead..606b2c0022 100644 --- a/Content.Server/Light/EntitySystems/MatchboxSystem.cs +++ b/Content.Server/Light/EntitySystems/MatchboxSystem.cs @@ -18,7 +18,7 @@ namespace Content.Server.Light.EntitySystems private void OnInteractUsing(EntityUid uid, MatchboxComponent component, InteractUsingEvent args) { if (!args.Handled - && EntityManager.TryGetComponent(args.Used, out var matchstick) + && EntityManager.TryGetComponent(args.Used, out MatchstickComponent? matchstick) && matchstick.CurrentState == SmokableState.Unlit) { _stickSystem.Ignite(args.Used, matchstick, args.User); diff --git a/Content.Server/Morgue/MorgueSystem.cs b/Content.Server/Morgue/MorgueSystem.cs index df9cd35b14..131689a139 100644 --- a/Content.Server/Morgue/MorgueSystem.cs +++ b/Content.Server/Morgue/MorgueSystem.cs @@ -62,7 +62,7 @@ public sealed class MorgueSystem : EntitySystem if (!hasMob && HasComp(ent)) hasMob = true; - if (HasComp(ent)) + if (HasComp(ent)) { _appearance.SetData(uid, MorgueVisuals.Contents, MorgueContents.HasSoul, app); return; diff --git a/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs b/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs index c9840ff235..2740f52b0c 100644 --- a/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs @@ -39,7 +39,7 @@ namespace Content.Server.Nutrition.EntitySystems { _audio.Play(_audio.GetSound(creamPie.Sound), Filter.Pvs(uid), uid, false, new AudioParams().WithVariation(0.125f)); - if (EntityManager.TryGetComponent(uid, out var foodComp)) + if (EntityManager.TryGetComponent(uid, out FoodComponent? foodComp)) { if (_solutions.TryGetSolution(uid, foodComp.SolutionName, out var solution)) { diff --git a/Content.Server/Power/Components/BaseNetConnectorComponent.cs b/Content.Server/Power/Components/BaseNetConnectorComponent.cs index 0b0492d1b8..f5c668838c 100644 --- a/Content.Server/Power/Components/BaseNetConnectorComponent.cs +++ b/Content.Server/Power/Components/BaseNetConnectorComponent.cs @@ -55,7 +55,7 @@ namespace Content.Server.Power.Components private bool TryFindNet([NotNullWhen(true)] out TNetType? foundNet) { - if (_entMan.TryGetComponent(Owner, out var container)) + if (_entMan.TryGetComponent(Owner, out NodeContainerComponent? container)) { var compatibleNet = container.Nodes.Values .Where(node => (NodeId == null || NodeId == node.Name) && node.NodeGroupID == (NodeGroupID) Voltage) diff --git a/Content.Server/Prayer/PrayerSystem.cs b/Content.Server/Prayer/PrayerSystem.cs index 2056586a41..be6ae80bfd 100644 --- a/Content.Server/Prayer/PrayerSystem.cs +++ b/Content.Server/Prayer/PrayerSystem.cs @@ -36,7 +36,7 @@ public sealed class PrayerSystem : EntitySystem private void AddPrayVerb(EntityUid uid, PrayableComponent comp, GetVerbsEvent args) { // if it doesn't have an actor and we can't reach it then don't add the verb - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; // this is to prevent ghosts from using it diff --git a/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs b/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs index 203e85b266..0b9148f0fb 100644 --- a/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs +++ b/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs @@ -79,7 +79,7 @@ namespace Content.Server.Sandbox.Commands foreach (var x in group.Nodes) { - if (!IoCManager.Resolve().TryGetComponent(x.Owner, out var atmosPipeColorComponent)) continue; + if (!IoCManager.Resolve().TryGetComponent(x.Owner, out AtmosPipeColorComponent? atmosPipeColorComponent)) continue; EntitySystem.Get().SetColor(x.Owner, atmosPipeColorComponent, color); } diff --git a/Content.Server/Tabletop/TabletopSystem.Session.cs b/Content.Server/Tabletop/TabletopSystem.Session.cs index 2f73d0e0d2..b6e182e936 100644 --- a/Content.Server/Tabletop/TabletopSystem.Session.cs +++ b/Content.Server/Tabletop/TabletopSystem.Session.cs @@ -78,7 +78,7 @@ namespace Content.Server.Tabletop if (session.Players.ContainsKey(player)) return; - if(EntityManager.TryGetComponent(attachedEntity, out var gamer)) + if(EntityManager.TryGetComponent(attachedEntity, out TabletopGamerComponent? gamer)) CloseSessionFor(player, gamer.Tabletop, false); // Set the entity as an absolute GAMER. diff --git a/Content.Server/Tabletop/TabletopSystem.cs b/Content.Server/Tabletop/TabletopSystem.cs index f76b2d9386..145ba33511 100644 --- a/Content.Server/Tabletop/TabletopSystem.cs +++ b/Content.Server/Tabletop/TabletopSystem.cs @@ -124,7 +124,7 @@ namespace Content.Server.Tabletop if (!args.CanAccess || !args.CanInteract) return; - if (!EntityManager.TryGetComponent(args.User, out var actor)) + if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return; var playVerb = new ActivationVerb() diff --git a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs index 5c43ce49a5..cef527a95c 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs @@ -61,7 +61,7 @@ namespace Content.Shared.Pulling return false; } - if (EntityManager.TryGetComponent(puller, out var buckle)) + if (EntityManager.TryGetComponent(puller, out BuckleComponent? buckle)) { // Prevent people pulling the chair they're on, etc. if (buckle is { PullStrap: false, Buckled: true } && (buckle.LastEntityBuckledTo == pulled)) @@ -113,11 +113,11 @@ namespace Content.Shared.Pulling public bool TryStartPull(EntityUid puller, EntityUid pullable) { - if (!EntityManager.TryGetComponent(puller, out var pullerComp)) + if (!EntityManager.TryGetComponent(puller, out SharedPullerComponent? pullerComp)) { return false; } - if (!EntityManager.TryGetComponent(pullable, out var pullableComp)) + if (!EntityManager.TryGetComponent(pullable, out SharedPullableComponent? pullableComp)) { return false; } @@ -154,7 +154,7 @@ namespace Content.Shared.Pulling var oldPullable = puller.Pulling; if (oldPullable != null) { - if (EntityManager.TryGetComponent(oldPullable.Value, out var oldPullableComp)) + if (EntityManager.TryGetComponent(oldPullable.Value, out SharedPullableComponent? oldPullableComp)) { if (!TryStopPull(oldPullableComp)) {