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,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user