Make the explosions throw the container/item they originated from (#32428)

Extra fun if it's something that can trigger multiple times
This commit is contained in:
Saphire Lattice
2024-10-07 22:31:34 +01:00
committed by deltanedas
parent 17c5c78fd3
commit 876486339b
@@ -487,9 +487,12 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
&& physics.BodyType == BodyType.Dynamic)
{
var pos = _transformSystem.GetWorldPosition(xform);
var dir = pos - epicenter.Position;
if (dir.IsLengthZero())
dir = _robustRandom.NextVector2().Normalized();
_throwingSystem.TryThrow(
uid,
pos - epicenter.Position,
dir,
physics,
xform,
_projectileQuery,