From: Saphire Lattice Date: Fri, 4 Oct 2024 08:43:45 +0000 (+0600) Subject: Make the explosions throw the container/item they originated from (#32428) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=88f060d51a0d36582c0705218d98d21a53789771;p=space-station-14.git Make the explosions throw the container/item they originated from (#32428) Extra fun if it's something that can trigger multiple times --- diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs index 5f14858f1f..ca2b0dbf9d 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs @@ -488,9 +488,12 @@ public sealed partial class ExplosionSystem && 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,