v1.6.18.1 (Unto the Breach Hotfix 1)

This commit is contained in:
Regalis11
2024-10-28 15:03:46 +02:00
parent a29662c074
commit 7eac44ea7d
47 changed files with 246 additions and 124 deletions
@@ -234,7 +234,8 @@ namespace Barotrauma.Items.Components
base.Update(deltaTime, cam);
if (targetCharacter != null)
{
if (SetTaintedOnDeath && targetCharacter.IsDead && !tainted)
if (SetTaintedOnDeath && !tainted &&
targetCharacter.IsDead && targetCharacter.CauseOfDeath is not { Type: CauseOfDeathType.Disconnected })
{
SetTainted(true);
}
@@ -850,7 +850,8 @@ namespace Barotrauma.Items.Components
private bool CanAutoInteractWithContained(Item containedItem)
{
return AutoInteractWithContained && autoInteractWithContainedTags.Any(t => containedItem.HasTag(t));
return AutoInteractWithContained &&
(autoInteractWithContainedTags.None() || autoInteractWithContainedTags.Any(t => containedItem.HasTag(t)));
}
private void SetContainedActive(bool active)
@@ -210,7 +210,7 @@ namespace Barotrauma.Items.Components
{
if (!powerOnSoundPlayed && powerOnSound != null)
{
SoundPlayer.PlaySound(powerOnSound.Sound, item.WorldPosition, powerOnSound.Volume, powerOnSound.Range, hullGuess: item.CurrentHull, ignoreMuffling: powerOnSound.IgnoreMuffling, freqMult: powerOnSound.GetRandomFrequencyMultiplier());
SoundPlayer.PlaySound(powerOnSound, item.WorldPosition, hullGuess: item.CurrentHull);
powerOnSoundPlayed = true;
}
}
@@ -243,7 +243,16 @@ namespace Barotrauma.Items.Components
public void SetPhysicsBodyPosition(bool ignoreContacts = true)
{
if (PhysicsBody == null) { return; }
Vector2 offset = ConvertUnits.ToSimUnits(BodyOffset * item.Scale);
if (item.FlippedX)
{
offset.X = -offset.X;
}
if (item.FlippedY)
{
offset.Y = -offset.Y;
}
if (!MathUtils.NearlyEqual(item.RotationRad, 0))
{
Matrix transform = Matrix.CreateRotationZ(-item.RotationRad);
@@ -260,6 +269,15 @@ namespace Barotrauma.Items.Components
PhysicsBody.UpdateDrawPosition();
}
public override void FlipX(bool relativeToSub)
{
SetPhysicsBodyPosition();
}
public override void FlipY(bool relativeToSub)
{
SetPhysicsBodyPosition();
}
public override void OnMapLoaded()
{
base.OnMapLoaded();