Named fixtures for banana peels (#3822)
* Named fixtures for banana peels * Soaps and PDAs * Update submodule
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Collision;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Singularity
|
||||
{
|
||||
@@ -11,7 +12,7 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
public override string Name => "ContainmentField";
|
||||
public ContainmentFieldConnection? Parent;
|
||||
|
||||
void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold)
|
||||
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
|
||||
{
|
||||
if (Parent == null)
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
return;
|
||||
}
|
||||
|
||||
Parent.TryRepell(Owner, otherBody.Entity);
|
||||
Parent.TryRepell(Owner, otherFixture.Body.Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ using Robust.Shared.Physics.Broadphase;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Physics.Collision;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Singularity
|
||||
{
|
||||
@@ -177,9 +178,9 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
}
|
||||
}
|
||||
|
||||
void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold)
|
||||
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
|
||||
{
|
||||
if(otherBody.Entity.HasTag("EmitterBolt")) {
|
||||
if(otherFixture.Body.Owner.HasTag("EmitterBolt")) {
|
||||
ReceivePower(4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Collision;
|
||||
using Robust.Shared.Physics.Collision.Shapes;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -121,13 +122,13 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
Energy -= EnergyDrain * seconds;
|
||||
}
|
||||
|
||||
void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold)
|
||||
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
|
||||
{
|
||||
var otherEntity = otherBody.Entity;
|
||||
var otherEntity = otherFixture.Body.Owner;
|
||||
|
||||
if (otherEntity.TryGetComponent<IMapGridComponent>(out var mapGridComponent))
|
||||
{
|
||||
foreach (var tile in mapGridComponent.Grid.GetTilesIntersecting(ourBody.GetWorldAABB()))
|
||||
foreach (var tile in mapGridComponent.Grid.GetTilesIntersecting(ourFixture.Body.GetWorldAABB()))
|
||||
{
|
||||
mapGridComponent.Grid.SetTile(tile.GridIndices, Tile.Empty);
|
||||
Energy++;
|
||||
|
||||
Reference in New Issue
Block a user