Fix DestructibleComponent sounds not playing.

This commit is contained in:
Pieter-Jan Briers
2020-05-24 20:40:09 +02:00
parent 8860ca6e2c
commit 26e07a627b

View File

@@ -71,10 +71,11 @@ namespace Content.Server.GameObjects.Components.Destructible
if (e.Passed && e.DamageThreshold == Threshold && destroyed == false) if (e.Passed && e.DamageThreshold == Threshold && destroyed == false)
{ {
destroyed = true; destroyed = true;
var pos = Owner.Transform.GridPosition;
_actSystem.HandleDestruction(Owner, true); _actSystem.HandleDestruction(Owner, true);
if(destroySound != string.Empty) if(destroySound != string.Empty)
{ {
_entitySystemManager.GetEntitySystem<AudioSystem>().Play(destroySound, Owner); _entitySystemManager.GetEntitySystem<AudioSystem>().Play(destroySound, pos);
} }