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); tile.HotspotExpose(700, 50, true);
var physics = Owner.GetComponent<IPhysBody>();
foreach (var uid in _collided.ToArray()) foreach (var uid in _collided.ToArray())
{ {
if (!uid.IsValid() || !Owner.EntityManager.EntityExists(uid)) if (!uid.IsValid() || !Owner.EntityManager.EntityExists(uid))
@@ -132,7 +134,6 @@ namespace Content.Server.GameObjects.Components.Atmos
} }
var entity = Owner.EntityManager.GetEntity(uid); var entity = Owner.EntityManager.GetEntity(uid);
var physics = Owner.GetComponent<IPhysBody>();
var otherPhysics = entity.GetComponent<IPhysBody>(); var otherPhysics = entity.GetComponent<IPhysBody>();
if (!physics.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB())) if (!physics.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB()))

View File

@@ -200,6 +200,8 @@ namespace Content.Shared.GameObjects.Components.Movement
if (!Slippery) if (!Slippery)
return; return;
var physics = Owner.GetComponent<IPhysBody>();
foreach (var uid in _colliding.ToArray()) foreach (var uid in _colliding.ToArray())
{ {
if (!uid.IsValid() || !Owner.EntityManager.EntityExists(uid)) if (!uid.IsValid() || !Owner.EntityManager.EntityExists(uid))
@@ -211,7 +213,6 @@ namespace Content.Shared.GameObjects.Components.Movement
} }
var entity = Owner.EntityManager.GetEntity(uid); var entity = Owner.EntityManager.GetEntity(uid);
var physics = Owner.GetComponent<IPhysBody>();
var otherPhysics = entity.GetComponent<IPhysBody>(); var otherPhysics = entity.GetComponent<IPhysBody>();
if (!physics.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB())) 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 - type: Slippery
intersectPercentage: 0.2 intersectPercentage: 0.2
- type: Physics - type: Physics
bodyType: KinematicController
mass: 5
fixtures: fixtures:
- shape: - shape:
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.2,-0.2,0.2,0.2" bounds: "-0.3,-0.4,0.3,0.4"
layer: layer:
- MobImpassable - SmallImpassable
mask:
- Impassable
- MobImpassable

View File

@@ -104,10 +104,11 @@
- type: Item - type: Item
sprite: Objects/Specific/Janitorial/soap.rsi sprite: Objects/Specific/Janitorial/soap.rsi
- type: Slippery - type: Slippery
paralyzeTime: 2.5 paralyzeTime: 2
intersectPercentage: 0.2
- type: Physics - type: Physics
bodyType: Dynamic bodyType: KinematicController
mass: 5 mass: 2.5
fixtures: fixtures:
- shape: - shape:
!type:PhysShapeAabb !type:PhysShapeAabb
@@ -115,9 +116,8 @@
layer: layer:
- SmallImpassable - SmallImpassable
mask: mask:
- SmallImpassable - Impassable
- MobImpassable - MobImpassable
hard: false
- type: entity - type: entity
name: soap name: soap