Fix fire extinguisher to use spray solution (#4616)
* Fix fire extinguisher to use spray solution * Fix FireExtinguisher more properly * Re-add missing check to VaporSystem
This commit is contained in:
@@ -66,12 +66,13 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!_solutionContainerSystem.TryGetSolution(vapor.Owner, SharedVaporComponent.SolutionName, out _))
|
||||
if (!_solutionContainerSystem.TryGetSolution(vapor.Owner, SharedVaporComponent.SolutionName,
|
||||
out var vaporSolution))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return _solutionContainerSystem.TryAddSolution(vapor.Owner.Uid, vaporSolution, solution);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Chemistry.Components;
|
||||
using Content.Server.Fluids.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -17,7 +18,6 @@ namespace Content.Server.Extinguisher
|
||||
public class FireExtinguisherComponent : Component, IAfterInteract
|
||||
{
|
||||
public override string Name => "FireExtinguisher";
|
||||
private const string SolutionName = "fireExtinguisher";
|
||||
|
||||
[DataField("refillSound")] SoundSpecifier _refillSound = new SoundPathSpecifier("/Audio/Effects/refill.ogg");
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Server.Extinguisher
|
||||
var targetEntity = eventArgs.Target;
|
||||
if (eventArgs.Target.HasComponent<ReagentTankComponent>()
|
||||
&& solutionContainerSystem.TryGetDrainableSolution(targetEntity.Uid, out var targetSolution)
|
||||
&& solutionContainerSystem.TryGetSolution(Owner, SolutionName, out var container))
|
||||
&& solutionContainerSystem.TryGetDrainableSolution(Owner.Uid, out var container))
|
||||
{
|
||||
var transfer = ReagentUnit.Min(container.AvailableVolume, targetSolution.DrainAvailable);
|
||||
if (transfer > 0)
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
size: 10
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
fireExtinguisher:
|
||||
spray:
|
||||
maxVol: 100
|
||||
reagents:
|
||||
- ReagentId: Water
|
||||
Quantity: 100
|
||||
- type: RefillableSolution
|
||||
solution: fireExtinguisher
|
||||
solution: spray
|
||||
- type: DrainableSolution
|
||||
solution: fireExtinguisher
|
||||
solution: spray
|
||||
- type: ItemCooldown
|
||||
- type: Spray
|
||||
spraySound:
|
||||
|
||||
Reference in New Issue
Block a user