From 48df8c07c82d0a2a158dd98717e05695837cf734 Mon Sep 17 00:00:00 2001 From: metalgearsloth Date: Fri, 27 Sep 2024 20:06:38 +1000 Subject: [PATCH] Remove IsTouching set on physics prediction 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. --- Robust.Client/Physics/PhysicsSystem.Predict.cs | 1 - Robust.Shared/Physics/Dynamics/Contacts/Contact.cs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Robust.Client/Physics/PhysicsSystem.Predict.cs b/Robust.Client/Physics/PhysicsSystem.Predict.cs index af16a3fd023..c21ea92d38d 100644 --- a/Robust.Client/Physics/PhysicsSystem.Predict.cs +++ b/Robust.Client/Physics/PhysicsSystem.Predict.cs @@ -156,7 +156,6 @@ internal void UpdateIsTouching(List toUpdate) if (activeA == false && activeB == false) { - contact.IsTouching = false; continue; } diff --git a/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs b/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs index e588fc93952..fb27d6eae5a 100644 --- a/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs +++ b/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs @@ -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 { @@ -94,11 +95,13 @@ internal Contact(IManifoldManager manifoldManager) /// /// Determines whether the contact is touching. /// + [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; } ///