diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs index bd9551511..f6aa7ed1c 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs @@ -110,7 +110,7 @@ namespace Barotrauma { get { - return collider == null ? null : collider[colliderIndex]; + return collider?[colliderIndex]; } } diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs index 9a93d357f..7845f609c 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs @@ -22,6 +22,10 @@ namespace Barotrauma.Items.Components private float blinkTimer; + private bool itemLoaded; + + private float blinkTimer; + public PhysicsBody ParentBody; [Editable(MinValueFloat = 0.0f, MaxValueFloat = 2048.0f), Serialize(100.0f, true)] @@ -77,7 +81,7 @@ namespace Barotrauma.Items.Components IsActive = value; #if SERVER - if (GameMain.Server != null && GameMain.Server.GameStarted) { item.CreateServerEvent(this); } + if (GameMain.Server != null && itemLoaded) { item.CreateServerEvent(this); } #endif } } @@ -156,7 +160,13 @@ namespace Barotrauma.Items.Components IsActive = IsOn; item.AddTag("light"); } - + + public override void OnItemLoaded() + { + base.OnItemLoaded(); + itemLoaded = true; + } + public override void Update(float deltaTime, Camera cam) { UpdateOnActiveEffects(deltaTime);