Fix thrown items colliding with non-hard entities (#8243)
* Fix pies colliding with non-hard(puddles) * Fix thrown items colliding with tables
This commit is contained in:
@@ -65,7 +65,7 @@ public enum CollisionGroup
|
|||||||
// Soap, spills
|
// Soap, spills
|
||||||
SlipLayer = MidImpassable | LowImpassable,
|
SlipLayer = MidImpassable | LowImpassable,
|
||||||
ItemMask = Impassable | HighImpassable,
|
ItemMask = Impassable | HighImpassable,
|
||||||
ThrownItem = Impassable | HighImpassable,
|
ThrownItem = Impassable | HighImpassable | BulletImpassable,
|
||||||
WallLayer = Opaque | Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable,
|
WallLayer = Opaque | Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable,
|
||||||
GlassLayer = Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable,
|
GlassLayer = Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable,
|
||||||
HalfWallLayer = MidImpassable | LowImpassable,
|
HalfWallLayer = MidImpassable | LowImpassable,
|
||||||
|
|||||||
@@ -63,12 +63,15 @@ namespace Content.Shared.Throwing
|
|||||||
}
|
}
|
||||||
var fixture = fixturesComponent.Fixtures.Values.First();
|
var fixture = fixturesComponent.Fixtures.Values.First();
|
||||||
var shape = fixture.Shape;
|
var shape = fixture.Shape;
|
||||||
var throwingFixture = new Fixture(physicsComponent, shape) { CollisionLayer = (int) CollisionGroup.ThrownItem, Hard = false, ID = ThrowingFixture };
|
var throwingFixture = new Fixture(physicsComponent, shape) { CollisionMask = (int) CollisionGroup.ThrownItem, Hard = false, ID = ThrowingFixture };
|
||||||
_fixtures.TryCreateFixture(physicsComponent, throwingFixture, manager: fixturesComponent);
|
_fixtures.TryCreateFixture(physicsComponent, throwingFixture, manager: fixturesComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleCollision(EntityUid uid, ThrownItemComponent component, StartCollideEvent args)
|
private void HandleCollision(EntityUid uid, ThrownItemComponent component, StartCollideEvent args)
|
||||||
{
|
{
|
||||||
|
if (args.OtherFixture.Hard == false)
|
||||||
|
return;
|
||||||
|
|
||||||
var thrower = component.Thrower;
|
var thrower = component.Thrower;
|
||||||
var otherBody = args.OtherFixture.Body;
|
var otherBody = args.OtherFixture.Body;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user