Named fixtures for banana peels (#3822)

* Named fixtures for banana peels

* Soaps and PDAs

* Update submodule
This commit is contained in:
metalgearsloth
2021-04-13 20:57:29 +10:00
committed by GitHub
parent 499cfe7c3d
commit dc48b25a3b
31 changed files with 124 additions and 97 deletions

View File

@@ -34,6 +34,7 @@ using Robust.Shared.ViewVariables;
using Timer = Robust.Shared.Timing.Timer;
using Content.Server.GameObjects.Components.Construction;
using Robust.Shared.Containers;
using Robust.Shared.Physics.Dynamics;
namespace Content.Server.GameObjects.Components.Doors
{
@@ -215,7 +216,7 @@ namespace Content.Server.GameObjects.Components.Doors
}
}
void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold)
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
{
if (State != DoorState.Closed)
{
@@ -229,9 +230,9 @@ namespace Content.Server.GameObjects.Components.Doors
// Disabled because it makes it suck hard to walk through double doors.
if (otherBody.Entity.HasComponent<IBody>())
if (otherFixture.Body.Owner.HasComponent<IBody>())
{
if (!otherBody.Entity.TryGetComponent<IMoverComponent>(out var mover)) return;
if (!otherFixture.Body.Owner.TryGetComponent<IMoverComponent>(out var mover)) return;
/*
// TODO: temporary hack to fix the physics system raising collision events akwardly.
@@ -244,7 +245,7 @@ namespace Content.Server.GameObjects.Components.Doors
TryOpen(entity);
*/
TryOpen(otherBody.Entity);
TryOpen(otherFixture.Body.Owner);
}
}
@@ -430,7 +431,7 @@ namespace Content.Server.GameObjects.Components.Doors
var broadPhaseSystem = EntitySystem.Get<SharedBroadPhaseSystem>();
// Use this version so we can ignore the CanCollide being false
foreach(var e in broadPhaseSystem.GetCollidingEntities(physicsComponent.Entity.Transform.MapID, physicsComponent.GetWorldAABB()))
foreach(var e in broadPhaseSystem.GetCollidingEntities(physicsComponent.Owner.Transform.MapID, physicsComponent.GetWorldAABB()))
{
if ((physicsComponent.CollisionMask & e.CollisionLayer) != 0 && broadPhaseSystem.IntersectionPercent(physicsComponent, e) > 0.01f) return true;
}
@@ -510,8 +511,8 @@ namespace Content.Server.GameObjects.Components.Doors
// Crush
foreach (var e in collidingentities)
{
if (!e.Entity.TryGetComponent(out StunnableComponent? stun)
|| !e.Entity.TryGetComponent(out IDamageableComponent? damage))
if (!e.Owner.TryGetComponent(out StunnableComponent? stun)
|| !e.Owner.TryGetComponent(out IDamageableComponent? damage))
{
continue;
}
@@ -522,7 +523,7 @@ namespace Content.Server.GameObjects.Components.Doors
continue;
hitsomebody = true;
CurrentlyCrushing.Add(e.Entity.Uid);
CurrentlyCrushing.Add(e.Owner.Uid);
damage.ChangeDamage(DamageType.Blunt, DoorCrushDamage, false, Owner);
stun.Paralyze(DoorStunTime);