From 6fe9130dd8a5b41262363ca4821d00034a99ccd2 Mon Sep 17 00:00:00 2001 From: juanjp600 Date: Mon, 14 Aug 2017 21:35:19 -0300 Subject: [PATCH] Fixed crash when projectiles stuck to items on dedicated server Report submitted by etet2, haven't tested it yet but I'm fairly certain this should fix the crash --- .../BarotraumaShared/Source/Items/Components/Projectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Projectile.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Projectile.cs index 7a7dd25f8..5724da0e7 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Projectile.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Projectile.cs @@ -232,7 +232,7 @@ namespace Barotrauma.Items.Components stickJoint.MaxMotorForce = 30.0f; stickJoint.LimitEnabled = true; - stickJoint.UpperLimit = ConvertUnits.ToSimUnits(item.Sprite.size.X*0.7f); + if (item.Sprite != null) stickJoint.UpperLimit = ConvertUnits.ToSimUnits(item.Sprite.size.X*0.7f); item.body.FarseerBody.IgnoreCollisionWith(targetBody); stickTarget = targetBody;