2024-02-28 15:59:35 -06:00
|
|
|
using Content.Server.Atmos.EntitySystems;
|
2024-09-01 17:27:13 -07:00
|
|
|
using Content.Shared.IgnitionSource;
|
2023-01-18 00:45:54 -08:00
|
|
|
|
|
|
|
|
namespace Content.Server.IgnitionSource;
|
2025-04-07 02:54:47 +02:00
|
|
|
public sealed partial class IgnitionSourceSystem : SharedIgnitionSourceSystem
|
2023-01-18 00:45:54 -08:00
|
|
|
{
|
2023-10-22 07:05:48 +01:00
|
|
|
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
|
2025-04-07 02:54:47 +02:00
|
|
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
2023-01-18 00:45:54 -08:00
|
|
|
|
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
{
|
|
|
|
|
base.Update(frameTime);
|
|
|
|
|
|
2023-10-19 12:34:31 -07:00
|
|
|
var query = EntityQueryEnumerator<IgnitionSourceComponent, TransformComponent>();
|
2023-10-22 07:05:48 +01:00
|
|
|
while (query.MoveNext(out var uid, out var comp, out var xform))
|
2023-01-18 00:45:54 -08:00
|
|
|
{
|
2023-10-22 07:05:48 +01:00
|
|
|
if (!comp.Ignited)
|
2023-01-18 00:45:54 -08:00
|
|
|
continue;
|
|
|
|
|
|
2023-10-22 07:05:48 +01:00
|
|
|
if (xform.GridUid is { } gridUid)
|
2023-01-18 00:45:54 -08:00
|
|
|
{
|
2023-10-22 07:05:48 +01:00
|
|
|
var position = _transform.GetGridOrMapTilePosition(uid, xform);
|
2025-04-07 02:54:47 +02:00
|
|
|
// TODO: Should this be happening every single tick?
|
2023-10-22 07:05:48 +01:00
|
|
|
_atmosphere.HotspotExpose(gridUid, position, comp.Temperature, 50, uid, true);
|
2023-01-18 00:45:54 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|