Remove FixtureId (#19280)

This commit is contained in:
metalgearsloth
2023-08-23 18:55:58 +10:00
committed by GitHub
parent 2cc1f8f0fe
commit 735626654a
23 changed files with 66 additions and 69 deletions

View File

@@ -429,17 +429,17 @@ public abstract class SharedEntityStorageSystem : EntitySystem
// RemovedMasks needs to be tracked separately for each fixture, using a fixture Id Dictionary. Also the
// fixture IDs probably cant be automatically generated without causing issues, unless there is some
// guarantee that they will get deserialized with the same auto-generated ID when saving+loading the map.
var fixture = fixtures.Fixtures.Values.First();
var fixture = fixtures.Fixtures.First();
if (component.Open)
{
component.RemovedMasks = fixture.CollisionLayer & component.MasksToRemove;
_physics.SetCollisionLayer(uid, fixture, fixture.CollisionLayer & ~component.MasksToRemove,
component.RemovedMasks = fixture.Value.CollisionLayer & component.MasksToRemove;
_physics.SetCollisionLayer(uid, fixture.Key, fixture.Value, fixture.Value.CollisionLayer & ~component.MasksToRemove,
manager: fixtures);
}
else
{
_physics.SetCollisionLayer(uid, fixture, fixture.CollisionLayer | component.RemovedMasks,
_physics.SetCollisionLayer(uid, fixture.Key, fixture.Value, fixture.Value.CollisionLayer | component.RemovedMasks,
manager: fixtures);
component.RemovedMasks = 0;
}