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