metal foam grenades (#29428)
* metal foam grenades * wow okay * meh * bruh * test * push
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Explosion.Components;
|
||||
using Content.Shared.Explosion.EntitySystems;
|
||||
using Content.Server.Fluids.EntitySystems;
|
||||
using Content.Server.Spreader;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Coordinates.Helpers;
|
||||
using Content.Shared.Maps;
|
||||
@@ -17,6 +18,7 @@ public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
|
||||
[Dependency] private readonly IMapManager _mapMan = default!;
|
||||
[Dependency] private readonly SmokeSystem _smoke = default!;
|
||||
[Dependency] private readonly TransformSystem _transform = default!;
|
||||
[Dependency] private readonly SpreaderSystem _spreader = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -31,11 +33,14 @@ public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
|
||||
var mapCoords = _transform.GetMapCoordinates(uid, xform);
|
||||
if (!_mapMan.TryFindGridAt(mapCoords, out _, out var grid) ||
|
||||
!grid.TryGetTileRef(xform.Coordinates, out var tileRef) ||
|
||||
tileRef.Tile.IsSpace())
|
||||
tileRef.Tile.IsEmpty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_spreader.RequiresFloorToSpread(comp.SmokePrototype.ToString()) && tileRef.Tile.IsSpace())
|
||||
return;
|
||||
|
||||
var coords = grid.MapToGrid(mapCoords);
|
||||
var ent = Spawn(comp.SmokePrototype, coords.SnapToGrid());
|
||||
if (!TryComp<SmokeComponent>(ent, out var smoke))
|
||||
|
||||
Reference in New Issue
Block a user