Changes required for serialization fix. (#7177)
This commit is contained in:
@@ -19,7 +19,7 @@ public sealed partial class TriggerSystem
|
|||||||
{
|
{
|
||||||
SubscribeLocalEvent<TriggerOnProximityComponent, StartCollideEvent>(OnProximityStartCollide);
|
SubscribeLocalEvent<TriggerOnProximityComponent, StartCollideEvent>(OnProximityStartCollide);
|
||||||
SubscribeLocalEvent<TriggerOnProximityComponent, EndCollideEvent>(OnProximityEndCollide);
|
SubscribeLocalEvent<TriggerOnProximityComponent, EndCollideEvent>(OnProximityEndCollide);
|
||||||
SubscribeLocalEvent<TriggerOnProximityComponent, ComponentStartup>(OnProximityStartup);
|
SubscribeLocalEvent<TriggerOnProximityComponent, MapInitEvent>(OnMapInit);
|
||||||
SubscribeLocalEvent<TriggerOnProximityComponent, ComponentShutdown>(OnProximityShutdown);
|
SubscribeLocalEvent<TriggerOnProximityComponent, ComponentShutdown>(OnProximityShutdown);
|
||||||
SubscribeLocalEvent<TriggerOnProximityComponent, AnchorStateChangedEvent>(OnProximityAnchor);
|
SubscribeLocalEvent<TriggerOnProximityComponent, AnchorStateChangedEvent>(OnProximityAnchor);
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ public sealed partial class TriggerSystem
|
|||||||
component.Colliding.Clear();
|
component.Colliding.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnProximityStartup(EntityUid uid, TriggerOnProximityComponent component, ComponentStartup args)
|
private void OnMapInit(EntityUid uid, TriggerOnProximityComponent component, MapInitEvent args)
|
||||||
{
|
{
|
||||||
component.Enabled = !component.RequiresAnchored ||
|
component.Enabled = !component.RequiresAnchored ||
|
||||||
EntityManager.GetComponent<TransformComponent>(uid).Anchored;
|
EntityManager.GetComponent<TransformComponent>(uid).Anchored;
|
||||||
@@ -58,7 +58,7 @@ public sealed partial class TriggerSystem
|
|||||||
|
|
||||||
if (!TryComp<PhysicsComponent>(uid, out var body)) return;
|
if (!TryComp<PhysicsComponent>(uid, out var body)) return;
|
||||||
|
|
||||||
_fixtures.CreateFixture(body, new Fixture(body, component.Shape)
|
_fixtures.TryCreateFixture(body, new Fixture(body, component.Shape)
|
||||||
{
|
{
|
||||||
// TODO: Should probably have these settable via datafield but I'm lazy and it's a pain
|
// TODO: Should probably have these settable via datafield but I'm lazy and it's a pain
|
||||||
CollisionLayer = (int) (CollisionGroup.MobImpassable | CollisionGroup.SmallImpassable | CollisionGroup.VaultImpassable), Hard = false, ID = TriggerOnProximityComponent.FixtureID
|
CollisionLayer = (int) (CollisionGroup.MobImpassable | CollisionGroup.SmallImpassable | CollisionGroup.VaultImpassable), Hard = false, ID = TriggerOnProximityComponent.FixtureID
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
// TODO: I want this to ideally be 2 fixtures to force them to have some level of alignment buuuttt
|
// TODO: I want this to ideally be 2 fixtures to force them to have some level of alignment buuuttt
|
||||||
// I also need collisionmanager for that yet again so they get dis.
|
// I also need collisionmanager for that yet again so they get dis.
|
||||||
_fixtureSystem.CreateFixture(physicsComponent, fixture);
|
_fixtureSystem.TryCreateFixture(physicsComponent, fixture);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
CollisionLayer = (int) CollisionGroup.MobImpassable
|
CollisionLayer = (int) CollisionGroup.MobImpassable
|
||||||
};
|
};
|
||||||
|
|
||||||
_fixtureSystem.CreateFixture(physicsComponent, fixture);
|
_fixtureSystem.TryCreateFixture(physicsComponent, fixture);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ namespace Content.Server.Storage.Components
|
|||||||
Contents.OccludesLight = _occludesLight;
|
Contents.OccludesLight = _occludesLight;
|
||||||
|
|
||||||
if(_entMan.TryGetComponent(Owner, out ConstructionComponent? construction))
|
if(_entMan.TryGetComponent(Owner, out ConstructionComponent? construction))
|
||||||
EntitySystem.Get<ConstructionSystem>().AddContainer(Owner, Contents.ID, construction);
|
EntitySystem.Get<ConstructionSystem>().AddContainer(Owner, nameof(EntityStorageComponent), construction);
|
||||||
|
|
||||||
if (_entMan.TryGetComponent<PlaceableSurfaceComponent?>(Owner, out var surface))
|
if (_entMan.TryGetComponent<PlaceableSurfaceComponent?>(Owner, out var surface))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ 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) { CollisionLayer = (int) CollisionGroup.ThrownItem, Hard = false, ID = ThrowingFixture };
|
||||||
_fixtures.CreateFixture(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)
|
||||||
|
|||||||
Reference in New Issue
Block a user