Skip to content

Commit

Permalink
v1.5.7.0 (Summer Update Hotfix 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Regalis11 committed Jun 19, 2024
1 parent 230d1b6 commit 169eced
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 20 deletions.
7 changes: 4 additions & 3 deletions Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,16 @@ public void Draw(SpriteBatch spriteBatch, bool editing, bool back = true, Color?
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();
Expand Down
2 changes: 1 addition & 1 deletion Barotrauma/BarotraumaClient/LinuxClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.5.7.0</Version>
<Version>1.5.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion Barotrauma/BarotraumaClient/MacClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.5.7.0</Version>
<Version>1.5.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion Barotrauma/BarotraumaClient/WindowsClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.5.7.0</Version>
<Version>1.5.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion Barotrauma/BarotraumaServer/LinuxServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.5.7.0</Version>
<Version>1.5.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion Barotrauma/BarotraumaServer/MacServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.5.7.0</Version>
<Version>1.5.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion Barotrauma/BarotraumaServer/WindowsServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.5.7.0</Version>
<Version>1.5.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4831,8 +4831,6 @@ public void Kill(CauseOfDeathType causeOfDeath, Affliction causeOfDeathAfflictio
}
#endif

ApplyStatusEffects(ActionType.OnDeath, 1.0f);

AnimController.Frozen = false;

Character killer = causeOfDeathAffliction?.Source;
Expand Down Expand Up @@ -4866,7 +4864,10 @@ public void Kill(CauseOfDeathType causeOfDeath, Affliction causeOfDeathAfflictio
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public void ModifyItemQuantityInSubSellCrate(Identifier storeIdentifier, ItemPre

public void PurchaseItems(Identifier storeIdentifier, List<PurchasedItem> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,14 @@ public Vector2 RotationLimits
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; }
Expand Down Expand Up @@ -319,8 +323,8 @@ public Vector2 RotationLimits

#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)
Expand Down Expand Up @@ -374,12 +378,14 @@ public override void OnMapLoaded()
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>())
{
connectionPanel.Connections.RemoveAll(c => c.Name is ToggleAutoOperatePin or SetAutoOperatePin);
connectionPanel.Connections.RemoveAll(c => c.Name is ToggleAutoOperateConnection or SetAutoOperateConnection && c.Wires.None());
}
}
}
Expand Down Expand Up @@ -1952,10 +1958,12 @@ public override void ReceiveSignal(Signal signal, Connection connection)
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;
Expand Down
8 changes: 8 additions & 0 deletions Barotrauma/BarotraumaShared/changelog.txt
Original file line number Diff line number Diff line change
@@ -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
-------------------------------------------------------------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 169eced

Please sign in to comment.