v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
@@ -75,6 +75,7 @@ namespace Barotrauma.Items.Components
|
||||
private void UpdateConvexHulls()
|
||||
{
|
||||
if (item.Removed) { return; }
|
||||
if (doorSprite == null) { return; }
|
||||
|
||||
doorRect = new Rectangle(
|
||||
item.Rect.Center.X - (int)(doorSprite.size.X / 2 * item.Scale),
|
||||
@@ -83,7 +84,7 @@ namespace Barotrauma.Items.Components
|
||||
(int)(doorSprite.size.Y * item.Scale));
|
||||
|
||||
Rectangle rect = doorRect;
|
||||
if (IsHorizontal)
|
||||
if (IsConvexHullHorizontal)
|
||||
{
|
||||
rect.Width = (int)(rect.Width * (1.0f - openState));
|
||||
}
|
||||
@@ -94,7 +95,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (Window.Height > 0 && Window.Width > 0)
|
||||
{
|
||||
if (IsHorizontal)
|
||||
if (IsConvexHullHorizontal)
|
||||
{
|
||||
rect.Width = (int)(Window.X * item.Scale);
|
||||
rect.X -= (int)(doorRect.Width * openState);
|
||||
@@ -163,8 +164,8 @@ namespace Barotrauma.Items.Components
|
||||
var verts = GetConvexHullCorners(rect);
|
||||
Vector2 center = (verts[0] + verts[2]) / 2;
|
||||
convexHull.SetVertices(
|
||||
verts,
|
||||
IsHorizontal ?
|
||||
verts,
|
||||
IsConvexHullHorizontal ?
|
||||
new Vector2[] { new Vector2(verts[0].X, center.Y), new Vector2(verts[2].X, center.Y) } :
|
||||
new Vector2[] { new Vector2(center.X, verts[0].Y), new Vector2(center.X, verts[2].Y) });
|
||||
convexHull.MaxMergeLosVerticesDist = 35.0f;
|
||||
@@ -304,6 +305,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
bool stateChanged = open != isOpen;
|
||||
isOpen = open;
|
||||
if (!isNetworkMessage || open != PredictedState)
|
||||
{
|
||||
@@ -314,6 +316,11 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
if (isOpen) { stuck = MathHelper.Clamp(stuck - StuckReductionOnOpen, 0.0f, 100.0f); }
|
||||
}
|
||||
if (stateChanged)
|
||||
{
|
||||
ActionType actionType = open ? ActionType.OnOpen : ActionType.OnClose;
|
||||
item.ApplyStatusEffects(actionType, deltaTime: 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void PlayInteractionSound()
|
||||
|
||||
Reference in New Issue
Block a user