v1.7.7.0 (Winter Update 2024)

This commit is contained in:
Regalis11
2024-12-11 13:26:13 +02:00
parent 7d5b7a310a
commit f6349b2175
256 changed files with 4794 additions and 1653 deletions
@@ -339,11 +339,11 @@ namespace Barotrauma
InitProjSpecific(element);
}
//use the maximum width of the sprite as the minimum surface width if no value is given
if (element != null && !element.Attributes("minsurfacewidth").Any())
//use (a bit less than) the maximum width of the sprite as the minimum surface width if no value is given
if (element != null && element.GetAttribute("minsurfacewidth") == null)
{
if (Sprites.Any()) MinSurfaceWidth = Sprites[0].size.X * MaxSize;
if (DeformableSprite != null) MinSurfaceWidth = Math.Max(MinSurfaceWidth, DeformableSprite.Size.X * MaxSize);
if (Sprites.Any()) { MinSurfaceWidth = Sprites[0].size.X * MaxSize * 0.8f; }
if (DeformableSprite != null) { MinSurfaceWidth = Math.Max(MinSurfaceWidth, DeformableSprite.Size.X * MaxSize * 0.8f); }
}
}
@@ -609,6 +609,21 @@ namespace Barotrauma
return;
}
if (PhysicsBody != null)
{
if (currentForceFluctuation <= 0.0f && statusEffects.None() && attacks.None())
{
//no force atm, and no status effects or attacks the trigger could apply
// -> we can disable the collider and get a minor physics performance improvement
PhysicsBody.Enabled = false;
return;
}
else
{
PhysicsBody.Enabled = true;
}
}
foreach (Entity triggerer in triggerers)
{
if (triggerer.Removed) { continue; }