hand teleport portals now may start in the same grid. (#28556)
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user