diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs index 4d230f621..0cd602cac 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs @@ -209,14 +209,20 @@ namespace Barotrauma.Lights if (Character.Controlled.FocusedItem != null) { Character.Controlled.FocusedItem.IsHighlighted = true; - Character.Controlled.FocusedItem.Draw(spriteBatch, false, true); - Character.Controlled.FocusedItem.IsHighlighted = true; } - else if (Character.Controlled.FocusedCharacter != null) + if (Character.Controlled.FocusedCharacter != null) { Character.Controlled.FocusedCharacter.Draw(spriteBatch); } + foreach (Item item in Item.ItemList) + { + if (item.IsHighlighted) + { + item.Draw(spriteBatch, false, true); + } + } + Vector2 drawPos = Character.Controlled.DrawPosition; drawPos.Y = -drawPos.Y; diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs index 824649cd8..07bd5dd0a 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs @@ -63,7 +63,7 @@ namespace Barotrauma.Lights if (position == value) return; position = value; - if (Vector2.Distance(prevCalculatedPosition, position) < 5.0f) return; + if (Vector2.DistanceSquared(prevCalculatedPosition, position) < 5.0f * 5.0f) return; NeedsHullCheck = true; NeedsRecalculation = true; diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs index 9bef9f2a4..3ae29c3e9 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs @@ -128,20 +128,17 @@ namespace Barotrauma.Items.Components #if CLIENT light.ParentSub = item.Submarine; -#endif - -#if CLIENT if (item.Container != null) { light.Color = Color.Transparent; return; } + light.Position = item.Position; #endif if (item.body != null) { #if CLIENT - light.Position = item.Position; light.Rotation = item.body.Dir > 0.0f ? item.body.Rotation : item.body.Rotation - MathHelper.Pi; #endif if (!item.body.Enabled) @@ -181,19 +178,17 @@ namespace Barotrauma.Items.Components voltage = 0.0f; } - - public override bool Use(float deltaTime, Character character = null) - { - return true; - } +#if CLIENT protected override void RemoveComponentSpecific() { base.RemoveComponentSpecific(); - -#if CLIENT light.Remove(); + } #endif + public override bool Use(float deltaTime, Character character = null) + { + return true; } public override void ReceiveSignal(int stepsTaken, string signal, Connection connection, Item source, Character sender, float power=0.0f)