Fix a criminal if in breathing code
This commit is contained in:
@@ -138,11 +138,14 @@ namespace Content.Server.GameObjects.Components.Body.Behavior
|
|||||||
|
|
||||||
public void Inhale(float frameTime)
|
public void Inhale(float frameTime)
|
||||||
{
|
{
|
||||||
if (Body != null && Body.Owner.TryGetComponent(out InternalsComponent? internals)
|
if (Body != null &&
|
||||||
&& internals.BreathToolEntity != null && internals.GasTankEntity != null
|
Body.Owner.TryGetComponent(out InternalsComponent? internals) &&
|
||||||
&& internals.BreathToolEntity.TryGetComponent(out BreathToolComponent? breathTool)
|
internals.BreathToolEntity != null &&
|
||||||
&& breathTool.IsFunctional && internals.GasTankEntity.TryGetComponent(out GasTankComponent? gasTank)
|
internals.GasTankEntity != null &&
|
||||||
&& gasTank.Air != null)
|
internals.BreathToolEntity.TryGetComponent(out BreathToolComponent? breathTool) &&
|
||||||
|
breathTool.IsFunctional &&
|
||||||
|
internals.GasTankEntity.TryGetComponent(out GasTankComponent? gasTank) &&
|
||||||
|
gasTank.Air != null)
|
||||||
{
|
{
|
||||||
Inhale(frameTime, gasTank.RemoveAirVolume(Atmospherics.BreathVolume));
|
Inhale(frameTime, gasTank.RemoveAirVolume(Atmospherics.BreathVolume));
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user