Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop

This commit is contained in:
EvilFactory
2025-04-10 10:37:09 -03:00
296 changed files with 8420 additions and 2945 deletions
@@ -831,9 +831,10 @@ namespace Barotrauma
{
if (character.DisableImpactDamageTimer > 0.0f) { return; }
if (f2.Body?.UserData is Item)
if (f2.Body?.UserData is Item &&
f2.Body.BodyType != BodyType.Static)
{
//no impact damage from items
//no impact damage from items with a non-static body
//items that can impact characters (melee weapons, projectiles) should handle the damage themselves
return;
}
@@ -1092,7 +1093,7 @@ namespace Barotrauma
Vector2 moveDir = hullDiff.LengthSquared() < 0.001f ? Vector2.UnitY : Vector2.Normalize(hullDiff);
//find a position 32 units away from the hull
if (MathUtils.GetLineRectangleIntersection(
if (MathUtils.GetLineWorldRectangleIntersection(
newHull.WorldPosition,
newHull.WorldPosition + moveDir * Math.Max(newHull.Rect.Width, newHull.Rect.Height),
new Rectangle(newHull.WorldRect.X - 32, newHull.WorldRect.Y + 32, newHull.WorldRect.Width + 64, newHull.Rect.Height + 64),