diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs index f78855c68..ce775b1e3 100644 --- a/Subsurface/Source/Characters/Animation/Ragdoll.cs +++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs @@ -869,6 +869,7 @@ namespace Barotrauma { //limb isn't in any room -> it's in the water limb.inWater = true; + if (limb.type == LimbType.Head) headInWater = true; } else if (limbHull.Volume > 0.0f && Submarine.RectContains(limbHull.Rect, limb.Position)) { diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index 0399c34c8..8460da409 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -1423,6 +1423,8 @@ namespace Barotrauma /// public HUDProgressBar UpdateHUDProgressBar(object linkedObject, Vector2 worldPosition, float progress, Color emptyColor, Color fullColor) { + if (controlled != this) return null; + HUDProgressBar progressBar = null; if (!hudProgressBars.TryGetValue(linkedObject, out progressBar)) { diff --git a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs index a7e4516ad..03bb4d26d 100644 --- a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs +++ b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs @@ -195,7 +195,7 @@ namespace Barotrauma.Items.Components 1.0f - targetStructure.SectionDamage(sectionIndex) / targetStructure.Health, Color.Red, Color.Green); - progressBar.Size = new Vector2(60.0f, 20.0f); + if (progressBar != null) progressBar.Size = new Vector2(60.0f, 20.0f); targetStructure.AddDamage(sectionIndex, -StructureFixAmount * degreeOfSuccess);