From 627187988e76b97e81663747faafb21da182ebe0 Mon Sep 17 00:00:00 2001
From: icekot8 <93311212+icekot8@users.noreply.github.com>
Date: Tue, 4 Jun 2024 19:34:07 +0300
Subject: [PATCH] hand teleport portals now may start in the same grid.
(#28556)
---
Content.Server/Teleportation/HandTeleporterSystem.cs | 2 +-
.../Teleportation/Components/HandTeleporterComponent.cs | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Content.Server/Teleportation/HandTeleporterSystem.cs b/Content.Server/Teleportation/HandTeleporterSystem.cs
index d4c6753c4b..1cd2e1d8c2 100644
--- a/Content.Server/Teleportation/HandTeleporterSystem.cs
+++ b/Content.Server/Teleportation/HandTeleporterSystem.cs
@@ -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);
diff --git a/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs b/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs
index 6abd4a7d21..6ea29d3fd6 100644
--- a/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs
+++ b/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs
@@ -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;
+ ///
+ /// Portals can't be placed on different grids?
+ ///
+ [DataField]
+ public bool AllowPortalsOnDifferentGrids;
+
[DataField("firstPortalPrototype", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string FirstPortalPrototype = "PortalRed";
--
2.51.2