Skip to content

Commit

Permalink
Use TurfSystem.IsTileBlocked instead of TurfHelpers (#32174)
Browse files Browse the repository at this point in the history
* Use TurfSystem.IsTileBlocked instead of TurfHelpers

* !
  • Loading branch information
Winkarst-cpu committed Sep 18, 2024
1 parent 974c085 commit 2bceaad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using Content.Shared.Maps;
using Content.Shared.Physics;
using Content.Shared.Stacks;
using JetBrains.Annotations;
using Robust.Shared.Map.Components;
Expand All @@ -15,6 +16,7 @@ public sealed class SpawnAfterInteractSystem : EntitySystem
{
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly StackSystem _stackSystem = default!;
[Dependency] private readonly TurfSystem _turfSystem = default!;

public override void Initialize()
{
Expand All @@ -36,7 +38,7 @@ private async void HandleAfterInteract(EntityUid uid, SpawnAfterInteractComponen

bool IsTileClear()
{
return tileRef.Tile.IsEmpty == false && !tileRef.IsBlockedTurf(true);
return tileRef.Tile.IsEmpty == false && !_turfSystem.IsTileBlocked(tileRef, CollisionGroup.MobMask);
}

if (!IsTileClear())
Expand Down
7 changes: 3 additions & 4 deletions Content.Server/Respawn/SpecialRespawnSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Chat.Managers;
using Content.Server.GameTicking;
using Content.Shared.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.Database;
using Content.Shared.Maps;
using Content.Shared.Physics;
using Content.Shared.Respawn;
using Content.Shared.Station.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

namespace Content.Server.Respawn;

Expand Down Expand Up @@ -179,7 +178,7 @@ public bool TryFindRandomTile(EntityUid targetGrid, EntityUid targetMap, int max

foreach (var newTileRef in grid.GetTilesIntersecting(circle))
{
if (newTileRef.IsSpace(_tileDefinitionManager) || newTileRef.IsBlockedTurf(true) || !_atmosphere.IsTileMixtureProbablySafe(targetGrid, targetMap, mapTarget))
if (newTileRef.IsSpace(_tileDefinitionManager) || _turf.IsTileBlocked(newTileRef, CollisionGroup.MobMask) || !_atmosphere.IsTileMixtureProbablySafe(targetGrid, targetMap, mapTarget))
continue;

found = true;
Expand Down

0 comments on commit 2bceaad

Please sign in to comment.