Fix space wind layer removal (#33888)
* Fix space wind layer removal * apply review * Update MovedByPressureComponent.cs * remove this
This commit is contained in:
@@ -56,14 +56,18 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
_physics.SetBodyStatus(uid, body, BodyStatus.OnGround);
|
||||
}
|
||||
|
||||
if (TryComp<FixturesComponent>(uid, out var fixtures))
|
||||
if (TryComp<FixturesComponent>(uid, out var fixtures)
|
||||
&& TryComp<MovedByPressureComponent>(uid, out var component))
|
||||
{
|
||||
foreach (var (id, fixture) in fixtures.Fixtures)
|
||||
{
|
||||
if (component.TableLayerRemoved.Contains(id))
|
||||
{
|
||||
_physics.AddCollisionMask(uid, id, fixture, (int)CollisionGroup.TableLayer, manager: fixtures);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var comp in toRemove)
|
||||
{
|
||||
@@ -80,9 +84,13 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
foreach (var (id, fixture) in fixtures.Fixtures)
|
||||
{
|
||||
// Mark fixtures that have TableLayer removed
|
||||
if ((fixture.CollisionMask & (int)CollisionGroup.TableLayer) != 0)
|
||||
{
|
||||
component.TableLayerRemoved.Add(id);
|
||||
_physics.RemoveCollisionMask(uid, id, fixture, (int)CollisionGroup.TableLayer, manager: fixtures);
|
||||
}
|
||||
|
||||
}
|
||||
// TODO: Make them dynamic type? Ehh but they still want movement so uhh make it non-predicted like weightless?
|
||||
// idk it's hard.
|
||||
|
||||
|
||||
@@ -27,5 +27,11 @@ public sealed partial class MovedByPressureComponent : Component
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int LastHighPressureMovementAirCycle { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Used to remember which fixtures we have to remove the table mask from and give it back accordingly
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public HashSet<string> TableLayerRemoved = new();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user