Refactor Flammable to be ECS. (#4671)
- Refactor IHotItem into IsHotEvent. - Refactor IFireAct into TileFireEvent.
This commit is contained in:
committed by
GitHub
parent
9bde39c533
commit
6cea9cb973
@@ -1,13 +1,15 @@
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.Reactions;
|
||||
using Content.Server.Coordinates.Helpers;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
public partial class AtmosphereSystem
|
||||
{
|
||||
[Dependency] private readonly GridTileLookupSystem _gridtileLookupSystem = default!;
|
||||
|
||||
private void ProcessHotspot(GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile)
|
||||
{
|
||||
if (!tile.Hotspot.Valid)
|
||||
@@ -137,14 +139,11 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
Merge(tile.Air, affected);
|
||||
}
|
||||
|
||||
var tileRef = tile.GridIndices.GetTileRef(tile.GridIndex, _mapManager);
|
||||
var fireEvent = new TileFireEvent(tile.Hotspot.Temperature, tile.Hotspot.Volume);
|
||||
|
||||
foreach (var entity in tileRef.GetEntitiesInTileFast())
|
||||
foreach (var entity in _gridtileLookupSystem.GetEntitiesIntersecting(tile.GridIndex, tile.GridIndices))
|
||||
{
|
||||
foreach (var fireAct in entity.GetAllComponents<IFireAct>())
|
||||
{
|
||||
fireAct.FireAct(tile.Hotspot.Temperature, tile.Hotspot.Volume);
|
||||
}
|
||||
RaiseLocalEvent(entity.Uid, fireEvent, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user