Skip to content

Commit

Permalink
Remove some obsolete methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored and stellar-novas committed Mar 23, 2024
1 parent b8b81c0 commit e604bb9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ private void AdjustEqMovement(TileAtmosphere tile, AtmosDirection direction, flo
if (adj == null)
{
var nonNull = tile.AdjacentTiles.Where(x => x != null).Count();
Logger.Error($"Encountered null adjacent tile in {nameof(AdjustEqMovement)}. Dir: {direction}, Tile: {tile.Tile}, non-null adj count: {nonNull}, Trace: {Environment.StackTrace}");
Log.Error($"Encountered null adjacent tile in {nameof(AdjustEqMovement)}. Dir: {direction}, Tile: ({tile.GridIndex}, {tile.GridIndices}), non-null adj count: {nonNull}, Trace: {Environment.StackTrace}");
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.Atmos.Components;
using Content.Shared.Atmos;
using Robust.Shared.Map.Components;

namespace Content.Server.Atmos.EntitySystems
{
Expand Down Expand Up @@ -93,7 +94,9 @@ public void NeighborConductWithSource(GridAtmosphereComponent gridAtmosphere, Ti
{
if (tile.Air == null)
{
if (other.Tile != null)
// TODO ATMOS: why does this need to check if a tile exists if it doesn't use the tile?
if (TryComp<MapGridComponent>(other.GridIndex, out var grid)
&& _mapSystem.TryGetTileRef(other.GridIndex, grid, other.GridIndices, out var _))
{
TemperatureShareOpenToSolid(other, tile);
}
Expand Down
3 changes: 0 additions & 3 deletions Content.Server/Atmos/TileAtmosphere.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ public sealed class TileAtmosphere : IGasMixtureHolder
[Access(typeof(AtmosphereSystem))]
public EntityUid GridIndex { get; set; }

[ViewVariables]
public TileRef? Tile => GridIndices.GetTileRef(GridIndex);

[ViewVariables]
public Vector2i GridIndices;

Expand Down
11 changes: 10 additions & 1 deletion Content.Server/Construction/Conditions/ComponentInTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Shared.Maps;
using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Utility;

namespace Content.Server.Construction.Conditions
Expand Down Expand Up @@ -48,7 +49,15 @@ public bool Condition(EntityUid uid, IEntityManager entityManager)

var indices = transform.Coordinates.ToVector2i(entityManager, IoCManager.Resolve<IMapManager>());
var lookup = entityManager.EntitySysManager.GetEntitySystem<EntityLookupSystem>();
var entities = indices.GetEntitiesInTile(transform.GridUid.Value, LookupFlags.Approximate | LookupFlags.Static, lookup);


if (!entityManager.TryGetComponent<MapGridComponent>(transform.GridUid.Value, out var grid))
return !HasEntity;

if (!entityManager.System<SharedMapSystem>().TryGetTileRef(transform.GridUid.Value, grid, indices, out var tile))
return !HasEntity;

var entities = tile.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.Static, lookup);

foreach (var ent in entities)
{
Expand Down

0 comments on commit e604bb9

Please sign in to comment.