29 lines
1011 B
C#
29 lines
1011 B
C#
using Content.Server.Atmos.EntitySystems;
|
|
using Content.Shared.IgnitionSource;
|
|
|
|
namespace Content.Server.IgnitionSource;
|
|
public sealed partial class IgnitionSourceSystem : SharedIgnitionSourceSystem
|
|
{
|
|
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
|
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
var query = EntityQueryEnumerator<IgnitionSourceComponent, TransformComponent>();
|
|
while (query.MoveNext(out var uid, out var comp, out var xform))
|
|
{
|
|
if (!comp.Ignited)
|
|
continue;
|
|
|
|
if (xform.GridUid is { } gridUid)
|
|
{
|
|
var position = _transform.GetGridOrMapTilePosition(uid, xform);
|
|
// TODO: Should this be happening every single tick?
|
|
_atmosphere.HotspotExpose(gridUid, position, comp.Temperature, 50, uid, true);
|
|
}
|
|
}
|
|
}
|
|
}
|