From f7363df19e629e2793d76c72de0931fc63996a03 Mon Sep 17 00:00:00 2001 From: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> Date: Tue, 17 May 2022 19:24:58 -0700 Subject: [PATCH] Fix thrown items colliding with non-hard entities (#8243) * Fix pies colliding with non-hard(puddles) * Fix thrown items colliding with tables --- Content.Shared/Physics/CollisionGroup.cs | 2 +- Content.Shared/Throwing/ThrownItemSystem.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Physics/CollisionGroup.cs b/Content.Shared/Physics/CollisionGroup.cs index f6762590ef..37a520a0a3 100644 --- a/Content.Shared/Physics/CollisionGroup.cs +++ b/Content.Shared/Physics/CollisionGroup.cs @@ -65,7 +65,7 @@ public enum CollisionGroup // Soap, spills SlipLayer = MidImpassable | LowImpassable, ItemMask = Impassable | HighImpassable, - ThrownItem = Impassable | HighImpassable, + ThrownItem = Impassable | HighImpassable | BulletImpassable, WallLayer = Opaque | Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable, GlassLayer = Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable, HalfWallLayer = MidImpassable | LowImpassable, diff --git a/Content.Shared/Throwing/ThrownItemSystem.cs b/Content.Shared/Throwing/ThrownItemSystem.cs index 4a1ba3941e..8f4aa963f4 100644 --- a/Content.Shared/Throwing/ThrownItemSystem.cs +++ b/Content.Shared/Throwing/ThrownItemSystem.cs @@ -63,12 +63,15 @@ namespace Content.Shared.Throwing } var fixture = fixturesComponent.Fixtures.Values.First(); var shape = fixture.Shape; - var throwingFixture = new Fixture(physicsComponent, shape) { CollisionLayer = (int) CollisionGroup.ThrownItem, Hard = false, ID = ThrowingFixture }; + var throwingFixture = new Fixture(physicsComponent, shape) { CollisionMask = (int) CollisionGroup.ThrownItem, Hard = false, ID = ThrowingFixture }; _fixtures.TryCreateFixture(physicsComponent, throwingFixture, manager: fixturesComponent); } private void HandleCollision(EntityUid uid, ThrownItemComponent component, StartCollideEvent args) { + if (args.OtherFixture.Hard == false) + return; + var thrower = component.Thrower; var otherBody = args.OtherFixture.Body;