diff --git a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs index 091bd8808a..262753307f 100644 --- a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs +++ b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs @@ -112,7 +112,7 @@ public abstract class SharedPortalSystem : EntitySystem if (TryComp(uid, out var link)) { - if (!link.LinkedEntities.Any()) + if (link.LinkedEntities.Count == 0) return; // client can't predict outside of simple portal-to-portal interactions due to randomness involved @@ -150,7 +150,7 @@ public abstract class SharedPortalSystem : EntitySystem private void OnEndCollide(EntityUid uid, PortalComponent component, ref EndCollideEvent args) { - if (!ShouldCollide(args.OurFixtureId, args.OtherFixtureId,args.OurFixture, args.OtherFixture)) + if (!ShouldCollide(args.OurFixtureId, args.OtherFixtureId, args.OurFixture, args.OtherFixture)) return; var subject = args.OtherEntity; @@ -162,14 +162,14 @@ public abstract class SharedPortalSystem : EntitySystem } } - private void TeleportEntity(EntityUid portal, EntityUid subject, EntityCoordinates target, EntityUid? targetEntity=null, bool playSound=true, + private void TeleportEntity(EntityUid portal, EntityUid subject, EntityCoordinates target, EntityUid? targetEntity = null, bool playSound = true, PortalComponent? portalComponent = null) { if (!Resolve(portal, ref portalComponent)) return; var ourCoords = Transform(portal).Coordinates; - var onSameMap = ourCoords.GetMapId(EntityManager) == target.GetMapId(EntityManager); + var onSameMap = _transform.GetMapId(ourCoords) == _transform.GetMapId(target); var distanceInvalid = portalComponent.MaxTeleportRadius != null && ourCoords.TryDistance(EntityManager, target, out var distance) && distance > portalComponent.MaxTeleportRadius; @@ -228,7 +228,7 @@ public abstract class SharedPortalSystem : EntitySystem { var randVector = _random.NextVector2(component.MaxRandomRadius); newCoords = coords.Offset(randVector); - if (!_lookup.GetEntitiesIntersecting(newCoords.ToMap(EntityManager, _transform), LookupFlags.Static).Any()) + if (!_lookup.AnyEntitiesIntersecting(_transform.ToMapCoordinates(newCoords), LookupFlags.Static)) { break; }