Refactor Flammable to be ECS. (#4671)

- Refactor IHotItem into IsHotEvent.
- Refactor IFireAct into TileFireEvent.
This commit is contained in:
Vera Aguilera Puerto
2021-09-22 11:05:33 +02:00
committed by GitHub
parent 9bde39c533
commit 6cea9cb973
21 changed files with 348 additions and 268 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using JetBrains.Annotations;
@@ -20,8 +21,9 @@ namespace Content.Server.Chemistry.ReagentEntityReactions
{
if (!entity.TryGetComponent(out FlammableComponent? flammable) || !_reagents.Contains(reagent.ID)) return;
flammable.Extinguish();
flammable.AdjustFireStacks(-1.5f);
var flammableSystem = EntitySystem.Get<FlammableSystem>();
flammableSystem.Extinguish(entity.Uid, flammable);
flammableSystem.AdjustFireStacks(entity.Uid, -1.5f, flammable);
}
}
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using JetBrains.Annotations;
@@ -20,7 +21,7 @@ namespace Content.Server.Chemistry.ReagentEntityReactions
{
if (!entity.TryGetComponent(out FlammableComponent? flammable) || !_reagents.Contains(reagent.ID)) return;
flammable.AdjustFireStacks(volume.Float() / 10f);
EntitySystem.Get<FlammableSystem>().AdjustFireStacks(entity.Uid, volume.Float() / 10f, flammable);
source?.RemoveReagent(reagent.ID, volume);
}
}