Fix mobs playing a falling sound when dying from crit (#2425)
* Fix falling sound playing twice when dying * But actually
This commit is contained in:
@@ -24,12 +24,6 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
appearance.SetData(RotationVisuals.RotationState, newState);
|
||||
}
|
||||
|
||||
if (playSound)
|
||||
{
|
||||
var file = AudioHelpers.GetRandomFileFromSoundCollection("bodyfall");
|
||||
Get<AudioSystem>().Play(file, entity, AudioHelpers.WithVariation(0.25f));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@ namespace Content.Server.GameObjects.Components.Mobs.State
|
||||
|
||||
public override void ExitState(IEntity entity)
|
||||
{
|
||||
EntitySystem.Get<StandingStateSystem>().Standing(entity);
|
||||
|
||||
if (entity.TryGetComponent(out ServerOverlayEffectsComponent overlay))
|
||||
{
|
||||
overlay.ClearOverlays();
|
||||
|
||||
@@ -44,8 +44,6 @@ namespace Content.Server.GameObjects.Components.Mobs.State
|
||||
|
||||
public override void ExitState(IEntity entity)
|
||||
{
|
||||
EntitySystem.Get<StandingStateSystem>().Standing(entity);
|
||||
|
||||
if (entity.TryGetComponent(out IPhysicsComponent physics))
|
||||
{
|
||||
physics.CanCollide = true;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Content.Server.GameObjects.Components.Body;
|
||||
using Content.Server.GameObjects.Components.Damage;
|
||||
using Content.Shared.GameObjects.Components.Body;
|
||||
using Content.Server.GameObjects.Components.Damage;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects.Components.Damage;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Content.Shared.GameObjects.Components.Mobs.State;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Mobs.State
|
||||
@@ -13,6 +13,8 @@ namespace Content.Server.GameObjects.Components.Mobs.State
|
||||
{
|
||||
public override void EnterState(IEntity entity)
|
||||
{
|
||||
EntitySystem.Get<StandingStateSystem>().Standing(entity);
|
||||
|
||||
if (entity.TryGetComponent(out AppearanceComponent appearance))
|
||||
{
|
||||
appearance.SetData(DamageStateVisuals.State, DamageState.Alive);
|
||||
|
||||
@@ -25,13 +25,13 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
if (newState != oldState)
|
||||
{
|
||||
appearance.SetData(RotationVisuals.RotationState, newState);
|
||||
}
|
||||
|
||||
if (playSound)
|
||||
{
|
||||
var file = AudioHelpers.GetRandomFileFromSoundCollection("bodyfall");
|
||||
Get<AudioSystem>().PlayFromEntity(file, entity, AudioHelpers.WithVariation(0.25f));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user