Update content for joints refactor (#4487)

* Update content for joints refactor

* Fix tumbler

* Fix pulling crash

* Fixes
This commit is contained in:
metalgearsloth
2021-10-04 15:35:03 +11:00
committed by GitHub
parent 571103554f
commit e801ffac45
2 changed files with 12 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ using Content.Shared.Pulling.Components;
using Robust.Client.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Physics;
namespace Content.Client.Physics.Controllers
{
@@ -29,10 +30,14 @@ namespace Content.Client.Physics.Controllers
// We set joints to predicted given these can affect how our mob moves.
// I would only recommend disabling this if you make pulling not use joints anymore (someday maybe?)
foreach (var joint in body.Joints)
if (player.TryGetComponent(out JointComponent? jointComponent))
{
joint.BodyA.Predict = true;
joint.BodyB.Predict = true;
foreach (var joint in jointComponent.GetJoints)
{
joint.BodyA.Predict = true;
joint.BodyB.Predict = true;
}
}
// If we're being pulled then we won't predict anything and will receive server lerps so it looks way smoother.