hand teleport portals now may start in the same grid. (#28556)

This commit is contained in:
icekot8
2024-06-04 19:34:07 +03:00
committed by GitHub
parent b394eb9e84
commit 627187988e
2 changed files with 8 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ public sealed class HandTeleporterSystem : EntitySystem
if (xform.ParentUid != xform.GridUid) // Still, don't portal. if (xform.ParentUid != xform.GridUid) // Still, don't portal.
return; 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.) // 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); FizzlePortals(uid, component, user, true);

View File

@@ -1,4 +1,4 @@
using Content.Shared.DoAfter; using Content.Shared.DoAfter;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
@@ -20,6 +20,12 @@ public sealed partial class HandTeleporterComponent : Component
[ViewVariables, DataField("secondPortal")] [ViewVariables, DataField("secondPortal")]
public EntityUid? SecondPortal = null; public EntityUid? SecondPortal = null;
/// <summary>
/// Portals can't be placed on different grids?
/// </summary>
[DataField]
public bool AllowPortalsOnDifferentGrids;
[DataField("firstPortalPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField("firstPortalPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string FirstPortalPrototype = "PortalRed"; public string FirstPortalPrototype = "PortalRed";