]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make `TryGetWires<T>` actually work. (#37937)
authorQuantum-cross <7065792+Quantum-cross@users.noreply.github.com>
Thu, 29 May 2025 23:48:27 +0000 (19:48 -0400)
committerGitHub <noreply@github.com>
Thu, 29 May 2025 23:48:27 +0000 (19:48 -0400)
Content.Server/Wires/WiresSystem.cs

index 3e75659072293ee1a949996895c8bd0f229ff5a7..397b199ecb8ce6bd1f93c9569e5f2f123d4ae322 100644 (file)
@@ -579,14 +579,14 @@ public sealed class WiresSystem : SharedWiresSystem
     ///     Tries to get all the wires on this entity by the wire action type.
     /// </summary>
     /// <returns>Enumerator of all wires in this entity according to the given type.</returns>
-    public IEnumerable<Wire> TryGetWires<T>(EntityUid uid, WiresComponent? wires = null)
+    public IEnumerable<Wire> TryGetWires<T>(EntityUid uid, WiresComponent? wires = null) where T: IWireAction
     {
         if (!Resolve(uid, ref wires))
             yield break;
 
         foreach (var wire in wires.WiresList)
         {
-            if (wire.GetType() == typeof(T))
+            if (wire.Action?.GetType() == typeof(T))
             {
                 yield return wire;
             }