Skip to content

Commit

Permalink
Remove IsTouching set on physics prediction
Browse files Browse the repository at this point in the history
Just because an entity sleeps doesn't mean it's not touching necessarily. This causes client to mispredict against server and continuously fire collision events if we try to move into an entity.

Easiest way to reproduced is to walk into a locked airlock and watch it flicker constantly.
  • Loading branch information
metalgearsloth committed Sep 27, 2024
1 parent 46291af commit 48df8c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion Robust.Client/Physics/PhysicsSystem.Predict.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ internal void UpdateIsTouching(List<Contact> toUpdate)

if (activeA == false && activeB == false)
{
contact.IsTouching = false;
continue;
}

Expand Down
3 changes: 3 additions & 0 deletions Robust.Shared/Physics/Dynamics/Contacts/Contact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.ViewVariables;

namespace Robust.Shared.Physics.Dynamics.Contacts
{
Expand Down Expand Up @@ -94,11 +95,13 @@ internal Contact(IManifoldManager manifoldManager)
/// <summary>
/// Determines whether the contact is touching.
/// </summary>
[ViewVariables]
public bool IsTouching { get; internal set; }

/// Enable/disable this contact. This can be used inside the pre-solve
/// contact listener. The contact is only disabled for the current
/// time step (or sub-step in continuous collisions).
[ViewVariables]
public bool Enabled { get; set; }

/// <summary>
Expand Down

0 comments on commit 48df8c0

Please sign in to comment.