From 0531dcb197a2e918498517ae74c455f427dd6ba6 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Mon, 15 Mar 2021 21:29:03 +0100 Subject: [PATCH] Fixes soap and banana peels going through walls when thrown. --- .../Components/Atmos/FlammableComponent.cs | 3 ++- .../Components/Movement/SlipperyComponent.cs | 3 ++- Resources/Changelog/Parts/soap.yml | 4 ++++ .../Entities/Objects/Consumable/trash.yml | 15 ++++++++++----- .../Entities/Objects/Specific/janitor.yml | 10 +++++----- 5 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 Resources/Changelog/Parts/soap.yml diff --git a/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs b/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs index 63c47ac7ef..a4553854ad 100644 --- a/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs @@ -123,6 +123,8 @@ namespace Content.Server.GameObjects.Components.Atmos tile.HotspotExpose(700, 50, true); + var physics = Owner.GetComponent(); + foreach (var uid in _collided.ToArray()) { if (!uid.IsValid() || !Owner.EntityManager.EntityExists(uid)) @@ -132,7 +134,6 @@ namespace Content.Server.GameObjects.Components.Atmos } var entity = Owner.EntityManager.GetEntity(uid); - var physics = Owner.GetComponent(); var otherPhysics = entity.GetComponent(); if (!physics.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB())) diff --git a/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs b/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs index 565a64537c..c8f3045022 100644 --- a/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs +++ b/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs @@ -200,6 +200,8 @@ namespace Content.Shared.GameObjects.Components.Movement if (!Slippery) return; + var physics = Owner.GetComponent(); + foreach (var uid in _colliding.ToArray()) { if (!uid.IsValid() || !Owner.EntityManager.EntityExists(uid)) @@ -211,7 +213,6 @@ namespace Content.Shared.GameObjects.Components.Movement } var entity = Owner.EntityManager.GetEntity(uid); - var physics = Owner.GetComponent(); var otherPhysics = entity.GetComponent(); if (!physics.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB())) diff --git a/Resources/Changelog/Parts/soap.yml b/Resources/Changelog/Parts/soap.yml new file mode 100644 index 0000000000..7646c05ad2 --- /dev/null +++ b/Resources/Changelog/Parts/soap.yml @@ -0,0 +1,4 @@ +author: Zumorica +changes: + - type: Fix + message: Fixes soap and banana peels going through walls when thrown. diff --git a/Resources/Prototypes/Entities/Objects/Consumable/trash.yml b/Resources/Prototypes/Entities/Objects/Consumable/trash.yml index 733c18ab5b..9c44a9658a 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/trash.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/trash.yml @@ -183,9 +183,14 @@ - type: Slippery intersectPercentage: 0.2 - type: Physics + bodyType: KinematicController + mass: 5 fixtures: - - shape: - !type:PhysShapeAabb - bounds: "-0.2,-0.2,0.2,0.2" - layer: - - MobImpassable + - shape: + !type:PhysShapeAabb + bounds: "-0.3,-0.4,0.3,0.4" + layer: + - SmallImpassable + mask: + - Impassable + - MobImpassable diff --git a/Resources/Prototypes/Entities/Objects/Specific/janitor.yml b/Resources/Prototypes/Entities/Objects/Specific/janitor.yml index d0c944b33c..fffe608eef 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/janitor.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/janitor.yml @@ -104,10 +104,11 @@ - type: Item sprite: Objects/Specific/Janitorial/soap.rsi - type: Slippery - paralyzeTime: 2.5 + paralyzeTime: 2 + intersectPercentage: 0.2 - type: Physics - bodyType: Dynamic - mass: 5 + bodyType: KinematicController + mass: 2.5 fixtures: - shape: !type:PhysShapeAabb @@ -115,9 +116,8 @@ layer: - SmallImpassable mask: - - SmallImpassable + - Impassable - MobImpassable - hard: false - type: entity name: soap