Fixes soap and banana peels going through walls when thrown.

This commit is contained in:
Vera Aguilera Puerto
2021-03-15 21:29:03 +01:00
parent e7052566a4
commit 0531dcb197
5 changed files with 23 additions and 12 deletions

View File

@@ -123,6 +123,8 @@ namespace Content.Server.GameObjects.Components.Atmos
tile.HotspotExpose(700, 50, true);
var physics = Owner.GetComponent<IPhysBody>();
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<IPhysBody>();
var otherPhysics = entity.GetComponent<IPhysBody>();
if (!physics.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB()))

View File

@@ -200,6 +200,8 @@ namespace Content.Shared.GameObjects.Components.Movement
if (!Slippery)
return;
var physics = Owner.GetComponent<IPhysBody>();
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<IPhysBody>();
var otherPhysics = entity.GetComponent<IPhysBody>();
if (!physics.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB()))

View File

@@ -0,0 +1,4 @@
author: Zumorica
changes:
- type: Fix
message: Fixes soap and banana peels going through walls when thrown.

View File

@@ -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"
bounds: "-0.3,-0.4,0.3,0.4"
layer:
- SmallImpassable
mask:
- Impassable
- MobImpassable

View File

@@ -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