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

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