if (TryComp<LinkedEntityComponent>(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
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;
}
}
- 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;
{
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;
}