Fix sound on material reclaimer (#21030)

* Fix saw sound error on client

The sound tried to play using shared PlayPvs which doesn't work on client. PlayPredicted handles client and server.

Fixed NextSound not playing again while continuously gibbing items.

* Fix duplicate splat sound on Recycler gibbing
This commit is contained in:
ShadowCommander
2023-10-15 22:30:35 -07:00
committed by GitHub
parent e40172e07b
commit c20bf50f40
2 changed files with 18 additions and 4 deletions

View File

@@ -166,13 +166,17 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
var xform = Transform(uid);
SpawnMaterialsFromComposition(uid, item, completion * component.Efficiency, xform: xform);
SpawnChemicalsFromComposition(uid, item, completion, component, xform);
if (CanGib(uid, item, component))
{
SpawnChemicalsFromComposition(uid, item, completion, false, component, xform);
_body.GibBody(item, true);
_appearance.SetData(uid, RecyclerVisuals.Bloody, true);
}
else
{
SpawnChemicalsFromComposition(uid, item, completion, true, component, xform);
}
QueueDel(item);
}
@@ -213,6 +217,7 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
private void SpawnChemicalsFromComposition(EntityUid reclaimer,
EntityUid item,
float efficiency,
bool sound = true,
MaterialReclaimerComponent? reclaimerComponent = null,
TransformComponent? xform = null,
PhysicalCompositionComponent? composition = null)
@@ -248,7 +253,7 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
_solutionContainer.TryTransferSolution(reclaimer, reclaimerComponent.OutputSolution, totalChemicals, totalChemicals.Volume);
if (totalChemicals.Volume > 0)
{
_puddle.TrySpillAt(reclaimer, totalChemicals, out _, transformComponent: xform);
_puddle.TrySpillAt(reclaimer, totalChemicals, out _, sound, transformComponent: xform);
}
}
}