From 6344ca16e04ef628ae39a7feafd6742e7038bb3a Mon Sep 17 00:00:00 2001 From: Saphire Date: Tue, 24 Sep 2024 13:06:09 +0600 Subject: [PATCH] Make the explosions throw the container/item they originated from Extra fun if it's something that can trigger multiple times --- .../Explosion/EntitySystems/ExplosionSystem.Processing.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs index 97d52e436a8f7e..7180ee47765819 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs @@ -488,9 +488,12 @@ private void ProcessEntity( && 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,