Content update for ECS physics (#13291)
This commit is contained in:
@@ -186,14 +186,12 @@ public sealed partial class BlockingSystem : EntitySystem
|
||||
|
||||
if (TryComp<PhysicsComponent>(user, out var physicsComponent))
|
||||
{
|
||||
var fixture = new Fixture(physicsComponent, component.Shape)
|
||||
{
|
||||
ID = BlockingComponent.BlockFixtureID,
|
||||
Hard = true,
|
||||
CollisionLayer = (int) CollisionGroup.WallLayer
|
||||
};
|
||||
|
||||
_fixtureSystem.TryCreateFixture(physicsComponent, fixture);
|
||||
_fixtureSystem.TryCreateFixture(user,
|
||||
component.Shape,
|
||||
BlockingComponent.BlockFixtureID,
|
||||
hard: true,
|
||||
collisionLayer: (int) CollisionGroup.WallLayer,
|
||||
body: physicsComponent);
|
||||
}
|
||||
|
||||
component.IsBlocking = true;
|
||||
@@ -243,8 +241,8 @@ public sealed partial class BlockingSystem : EntitySystem
|
||||
_transformSystem.Unanchor(xform);
|
||||
|
||||
_actionsSystem.SetToggled(component.BlockingToggleAction, false);
|
||||
_fixtureSystem.DestroyFixture(physicsComponent, BlockingComponent.BlockFixtureID);
|
||||
_physics.SetBodyType(physicsComponent, blockingUserComponent.OriginalBodyType);
|
||||
_fixtureSystem.DestroyFixture(user, BlockingComponent.BlockFixtureID, body: physicsComponent);
|
||||
_physics.SetBodyType(user, blockingUserComponent.OriginalBodyType, body: physicsComponent);
|
||||
_popupSystem.PopupEntity(msgUser, user, user);
|
||||
_popupSystem.PopupEntity(msgOther, user, Filter.PvsExcept(user), true);
|
||||
}
|
||||
|
||||
@@ -31,9 +31,8 @@ public sealed class BlockingComponent : Component
|
||||
/// <summary>
|
||||
/// The shape of the blocking fixture that will be dynamically spawned
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("shape")]
|
||||
public IPhysShape Shape = new PhysShapeCircle {Radius = 0.5F};
|
||||
[ViewVariables(VVAccess.ReadWrite)] [DataField("shape")]
|
||||
public IPhysShape Shape = new PhysShapeCircle(0.5f);
|
||||
|
||||
/// <summary>
|
||||
/// The damage modifer to use while passively blocking
|
||||
|
||||
Reference in New Issue
Block a user