From 3e3ec5a2ef2ec9e9de2dbd0835836560b9a0f50a Mon Sep 17 00:00:00 2001 From: Regalis Date: Mon, 27 Jun 2016 18:38:11 +0300 Subject: [PATCH] Fixed fire extinquishers --- Subsurface/Source/Items/Components/Holdable/RepairTool.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs index e23911b06..63a4cdd7f 100644 --- a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs +++ b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs @@ -154,9 +154,12 @@ namespace Barotrauma.Items.Components pickedPosition = Submarine.LastPickedPosition; - if (ExtinquishAmount > 0.0f) + if (ExtinquishAmount > 0.0f && item.CurrentHull != null) { - Vector2 displayPos = rayStart + (rayEnd - rayStart) * Submarine.LastPickedFraction * 0.9f; + Vector2 displayPos = ConvertUnits.ToDisplayUnits(rayStart + (rayEnd - rayStart) * Submarine.LastPickedFraction * 0.9f); + + displayPos += item.CurrentHull.Submarine.Position; + Hull hull = Hull.FindHull(displayPos, item.CurrentHull); if (hull != null) hull.Extinquish(deltaTime, ExtinquishAmount, displayPos); }