Cleanup warnings in SmokeOnTriggerSystem (#37754)

Cleanup 2 warnings in SmokeOnTriggerSystem
This commit is contained in:
Tayrtahn
2025-05-23 11:56:10 -04:00
committed by GitHub
parent c1f1eaa0c3
commit 7ba81173bd

View File

@@ -16,6 +16,7 @@ namespace Content.Server.Explosion.EntitySystems;
public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
{
[Dependency] private readonly IMapManager _mapMan = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
[Dependency] private readonly SmokeSystem _smoke = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly SpreaderSystem _spreader = default!;
@@ -31,8 +32,8 @@ public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
{
var xform = Transform(uid);
var mapCoords = _transform.GetMapCoordinates(uid, xform);
if (!_mapMan.TryFindGridAt(mapCoords, out _, out var grid) ||
!grid.TryGetTileRef(xform.Coordinates, out var tileRef) ||
if (!_mapMan.TryFindGridAt(mapCoords, out var gridUid, out var grid) ||
!_map.TryGetTileRef(gridUid, grid, xform.Coordinates, out var tileRef) ||
tileRef.Tile.IsEmpty)
{
return;
@@ -41,7 +42,7 @@ public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
if (_spreader.RequiresFloorToSpread(comp.SmokePrototype.ToString()) && tileRef.Tile.IsSpace())
return;
var coords = grid.MapToGrid(mapCoords);
var coords = _map.MapToGrid(gridUid, mapCoords);
var ent = Spawn(comp.SmokePrototype, coords.SnapToGrid());
if (!TryComp<SmokeComponent>(ent, out var smoke))
{