From 4eccdc73eeee484e553a25c43808e11df49cb4c0 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 28 Jun 2022 14:43:00 +1000 Subject: [PATCH] Bandaid awakebodies for tilefriction (#9249) --- Content.Shared/Friction/SharedTileFrictionController.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Friction/SharedTileFrictionController.cs b/Content.Shared/Friction/SharedTileFrictionController.cs index 1576265260..5246837e8b 100644 --- a/Content.Shared/Friction/SharedTileFrictionController.cs +++ b/Content.Shared/Friction/SharedTileFrictionController.cs @@ -78,7 +78,14 @@ namespace Content.Shared.Friction if (body.LinearVelocity.Equals(Vector2.Zero) && body.AngularVelocity.Equals(0f)) continue; DebugTools.Assert(!Deleted(body.Owner)); - var surfaceFriction = GetTileFriction(body, xformQuery.GetComponent(body.Owner)); + + if (!xformQuery.TryGetComponent(body.Owner, out var xform)) + { + Logger.ErrorS("physics", $"Unable to get transform for {ToPrettyString(body.Owner)} in tilefrictioncontroller"); + continue; + } + + var surfaceFriction = GetTileFriction(body, xform); var bodyModifier = 1f; if (frictionQuery.TryGetComponent(body.Owner, out var frictionComp))