Changes required for serialization fix. (#7177)

This commit is contained in:
Leon Friedrich
2022-03-25 23:56:05 +13:00
committed by GitHub
parent 67c42ecacd
commit ec824896ee
5 changed files with 7 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ public sealed partial class TriggerSystem
{
SubscribeLocalEvent<TriggerOnProximityComponent, StartCollideEvent>(OnProximityStartCollide);
SubscribeLocalEvent<TriggerOnProximityComponent, EndCollideEvent>(OnProximityEndCollide);
SubscribeLocalEvent<TriggerOnProximityComponent, ComponentStartup>(OnProximityStartup);
SubscribeLocalEvent<TriggerOnProximityComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<TriggerOnProximityComponent, ComponentShutdown>(OnProximityShutdown);
SubscribeLocalEvent<TriggerOnProximityComponent, AnchorStateChangedEvent>(OnProximityAnchor);
}
@@ -49,7 +49,7 @@ public sealed partial class TriggerSystem
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 ||
EntityManager.GetComponent<TransformComponent>(uid).Anchored;
@@ -58,7 +58,7 @@ public sealed partial class TriggerSystem
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
CollisionLayer = (int) (CollisionGroup.MobImpassable | CollisionGroup.SmallImpassable | CollisionGroup.VaultImpassable), Hard = false, ID = TriggerOnProximityComponent.FixtureID

View File

@@ -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
// I also need collisionmanager for that yet again so they get dis.
_fixtureSystem.CreateFixture(physicsComponent, fixture);
_fixtureSystem.TryCreateFixture(physicsComponent, fixture);
}
/// <summary>

View File

@@ -266,7 +266,7 @@ namespace Content.Server.Shuttles.EntitySystems
CollisionLayer = (int) CollisionGroup.MobImpassable
};
_fixtureSystem.CreateFixture(physicsComponent, fixture);
_fixtureSystem.TryCreateFixture(physicsComponent, fixture);
}
break;

View File

@@ -164,7 +164,7 @@ namespace Content.Server.Storage.Components
Contents.OccludesLight = _occludesLight;
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))
{

View File

@@ -67,7 +67,7 @@ namespace Content.Shared.Throwing
var fixture = fixturesComponent.Fixtures.Values.First();
var shape = fixture.Shape;
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)