]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
hand teleport portals now may start in the same grid. (#28556)
authoricekot8 <93311212+icekot8@users.noreply.github.com>
Tue, 4 Jun 2024 16:34:07 +0000 (19:34 +0300)
committerGitHub <noreply@github.com>
Tue, 4 Jun 2024 16:34:07 +0000 (12:34 -0400)
Content.Server/Teleportation/HandTeleporterSystem.cs
Content.Shared/Teleportation/Components/HandTeleporterComponent.cs

index d4c6753c4b523d3ab8b6cdd9ad837d2bcd99595b..1cd2e1d8c25ce33eb45171de4defaf034ce6e4f9 100644 (file)
@@ -98,7 +98,7 @@ public sealed class HandTeleporterSystem : EntitySystem
             if (xform.ParentUid != xform.GridUid) // Still, don't portal.
                 return;
 
-            if (xform.ParentUid != Transform(component.FirstPortal!.Value).ParentUid)
+            if (!component.AllowPortalsOnDifferentGrids && xform.ParentUid != Transform(component.FirstPortal!.Value).ParentUid)
             {
                 // Whoops. Fizzle time. Crime time too because yippee I'm not refactoring this logic right now (I started to, I'm not going to.)
                 FizzlePortals(uid, component, user, true);
index 6abd4a7d2114bff1f67a5971da36415e1298e4ed..6ea29d3fd6ad5c5e8cd18f4e1c84089a21aaf18d 100644 (file)
@@ -1,4 +1,4 @@
-using Content.Shared.DoAfter;
+using Content.Shared.DoAfter;
 using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
@@ -20,6 +20,12 @@ public sealed partial class HandTeleporterComponent : Component
     [ViewVariables, DataField("secondPortal")]
     public EntityUid? SecondPortal = null;
 
+    /// <summary>
+    ///     Portals can't be placed on different grids?
+    /// </summary>
+    [DataField]
+    public bool AllowPortalsOnDifferentGrids;
+
     [DataField("firstPortalPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
     public string FirstPortalPrototype = "PortalRed";