private void OnAnchorAttempt(EntityUid uid, SubFloorHideComponent component, AnchorAttemptEvent args) { // No teleporting entities through floor tiles when anchoring them. var xform = Transform(uid); if (MapManager.TryGetGrid(xform.GridID, out var grid) && HasFloorCover(grid, grid.TileIndicesFor(xform.Coordinates))) { args.Cancel(); } }
private void OnPortableAnchorAttempt(EntityUid uid, GasPortableComponent component, AnchorAttemptEvent args) { if (!EntityManager.TryGetComponent(uid, out TransformComponent? transform)) { return; } // If we can't find any ports, cancel the anchoring. if (!FindGasPortIn(transform.GridID, transform.Coordinates, out _)) { args.Cancel(); } }