diff --git a/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs b/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs index c615ed2f2..b626f62d4 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs @@ -458,15 +458,16 @@ namespace Barotrauma if (!back) { return; } if (holdable.Picker.Inventory?.GetItemInLimbSlot(InvSlotType.RightHand) == this) { - depth = GetHeldItemDepth(LimbType.RightHand, depth); + depth = GetHeldItemDepth(LimbType.RightHand, holdable, depth); } else if (holdable.Picker.Inventory?.GetItemInLimbSlot(InvSlotType.LeftHand) == this) { - depth = GetHeldItemDepth(LimbType.LeftHand, depth); + depth = GetHeldItemDepth(LimbType.LeftHand, holdable, depth); } - float GetHeldItemDepth(LimbType limb, float depth) + static float GetHeldItemDepth(LimbType limb, Holdable holdable, float depth) { + if (holdable?.Picker?.AnimController == null) { return depth; } //offset used to make sure the item draws just slightly behind the right hand, or slightly in front of the left hand float limbDepthOffset = 0.000001f; float depthOffset = holdable.Picker.AnimController.GetDepthOffset(); diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj index 26264d70b..8957de022 100644 --- a/Barotrauma/BarotraumaClient/LinuxClient.csproj +++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.5.7.0 + 1.5.8.0 Copyright © FakeFish 2018-2024 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj index 6401060dd..848c3c9b3 100644 --- a/Barotrauma/BarotraumaClient/MacClient.csproj +++ b/Barotrauma/BarotraumaClient/MacClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.5.7.0 + 1.5.8.0 Copyright © FakeFish 2018-2024 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/WindowsClient.csproj b/Barotrauma/BarotraumaClient/WindowsClient.csproj index 95348b2e7..1455503dd 100644 --- a/Barotrauma/BarotraumaClient/WindowsClient.csproj +++ b/Barotrauma/BarotraumaClient/WindowsClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.5.7.0 + 1.5.8.0 Copyright © FakeFish 2018-2024 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaServer/LinuxServer.csproj b/Barotrauma/BarotraumaServer/LinuxServer.csproj index cdcbc590f..9005119d8 100644 --- a/Barotrauma/BarotraumaServer/LinuxServer.csproj +++ b/Barotrauma/BarotraumaServer/LinuxServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.5.7.0 + 1.5.8.0 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/MacServer.csproj b/Barotrauma/BarotraumaServer/MacServer.csproj index c0b09740b..920854b33 100644 --- a/Barotrauma/BarotraumaServer/MacServer.csproj +++ b/Barotrauma/BarotraumaServer/MacServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.5.7.0 + 1.5.8.0 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/WindowsServer.csproj b/Barotrauma/BarotraumaServer/WindowsServer.csproj index 401e3d30a..31a1cd1f7 100644 --- a/Barotrauma/BarotraumaServer/WindowsServer.csproj +++ b/Barotrauma/BarotraumaServer/WindowsServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.5.7.0 + 1.5.8.0 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs index abe6bd9ae..6e2a69bc8 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs @@ -4831,8 +4831,6 @@ namespace Barotrauma } #endif - ApplyStatusEffects(ActionType.OnDeath, 1.0f); - AnimController.Frozen = false; Character killer = causeOfDeathAffliction?.Source; @@ -4866,7 +4864,10 @@ namespace Barotrauma info.LastResistanceMultiplierSkillLossRespawn = GetAbilityResistance(Tags.SkillLossRespawnResistance); } + //it's important that we set isDead before executing the status effects, + //otherwise a statuseffect might kill the character "again" and trigger a loop that crashes the game isDead = true; + ApplyStatusEffects(ActionType.OnDeath, 1.0f); #if CLIENT // Keep permadeath status in sync (to show it correctly in the UI, the server takes care of the actual logic) diff --git a/Barotrauma/BarotraumaShared/SharedSource/GameSession/CargoManager.cs b/Barotrauma/BarotraumaShared/SharedSource/GameSession/CargoManager.cs index 13f857f12..c51451308 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/GameSession/CargoManager.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/GameSession/CargoManager.cs @@ -298,7 +298,7 @@ namespace Barotrauma public void PurchaseItems(Identifier storeIdentifier, List itemsToPurchase, bool removeFromCrate, Client client = null) { - var store = Location.GetStore(storeIdentifier); + var store = Location?.GetStore(storeIdentifier); if (store == null) { return; } var itemsPurchasedFromStore = GetPurchasedItems(storeIdentifier, create: true); // Check all the prices before starting the transaction to make sure the modifiers stay the same for the whole transaction diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Turret.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Turret.cs index 04548a5d6..aff32221d 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Turret.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Turret.cs @@ -269,10 +269,14 @@ namespace Barotrauma.Items.Components public Color HudTint { get; set; } [Header(localizedTextTag: "sp.turret.AutoOperate.propertyheader")] - [Serialize(false, IsPropertySaveable.Yes, description:"Should the turret operate automatically using AI targeting? Comes with some optional random movement that can be adjusted below."), + [Serialize(false, IsPropertySaveable.Yes, description: "Should the turret operate automatically using AI targeting? Comes with some optional random movement that can be adjusted below."), Editable(TransferToSwappedItem = true)] public bool AutoOperate { get; set; } + [Serialize(false, IsPropertySaveable.Yes, description: "Can the Auto Operate functionality be enabled using signals to the turret?"), + Editable(TransferToSwappedItem = true)] + public bool AllowAutoOperateWithWiring { get; set; } + [Serialize(0f, IsPropertySaveable.Yes, description: "[Auto Operate] How much the turret should adjust the aim off the target randomly instead of tracking the target perfectly? In Degrees."), Editable(TransferToSwappedItem = true)] public float RandomAimAmount { get; set; } @@ -319,8 +323,8 @@ namespace Barotrauma.Items.Components #endregion - private const string SetAutoOperatePin = "set_auto_operate"; - private const string ToggleAutoOperatePin = "toggle_auto_operate"; + private const string SetAutoOperateConnection = "set_auto_operate"; + private const string ToggleAutoOperateConnection = "toggle_auto_operate"; public Turret(Item item, ContentXElement element) : base(item, element) @@ -374,12 +378,14 @@ namespace Barotrauma.Items.Components if (loadedBaseRotation.HasValue) { BaseRotation = loadedBaseRotation.Value; } targetRotation = Rotation; UpdateTransformedBarrelPos(); - if (!AutoOperate) + if (!AllowAutoOperateWithWiring && + Screen.Selected is { IsEditor: false }) { - // If the turret is not set to auto operate, don't allow changing the state with wirings. + // If the turret is not set to auto operate and the auto operate connections haven't been wired to anything, + // don't allow changing the state with wirings. foreach (ConnectionPanel connectionPanel in Item.GetComponents()) { - connectionPanel.Connections.RemoveAll(c => c.Name is ToggleAutoOperatePin or SetAutoOperatePin); + connectionPanel.Connections.RemoveAll(c => c.Name is ToggleAutoOperateConnection or SetAutoOperateConnection && c.Wires.None()); } } } @@ -1952,10 +1958,12 @@ namespace Barotrauma.Items.Components UpdateLightComponents(); } break; - case SetAutoOperatePin: + case SetAutoOperateConnection: + if (!AllowAutoOperateWithWiring) { return; } AutoOperate = signal.value != "0"; break; - case ToggleAutoOperatePin: + case ToggleAutoOperateConnection: + if (!AllowAutoOperateWithWiring) { return; } if (signal.value != "0") { AutoOperate = !AutoOperate; diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt index 0e6507e08..432b16ae8 100644 --- a/Barotrauma/BarotraumaShared/changelog.txt +++ b/Barotrauma/BarotraumaShared/changelog.txt @@ -1,4 +1,12 @@ ------------------------------------------------------------------------------------------------------------------------------------------------- +v1.5.8.0 +------------------------------------------------------------------------------------------------------------------------------------------------- + +- Fixed crashing when killing a defense bot or a leucocyte. +- Fixed directional flak ammo box still being carried with 2 hands. +- Fixed set_auto_operate and toggle_auto_operate disappearing at the start of the round if AutoOperate is not enabled. Now there's a setting called "Allow Auto Operate With Wiring" which can be enabled in the sub editor to enable the connections. + +------------------------------------------------------------------------------------------------------------------------------------------------- v1.5.7.0 -------------------------------------------------------------------------------------------------------------------------------------------------