v1.0.20.1 (summer patch)
This commit is contained in:
@@ -69,7 +69,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private bool isBroken;
|
||||
|
||||
public bool CanBeTraversed => (IsOpen || IsBroken) && !IsJammed && !IsStuck && !Impassable;
|
||||
public bool CanBeTraversed => !Impassable && (IsBroken || IsOpen);
|
||||
|
||||
public bool IsBroken
|
||||
{
|
||||
@@ -186,13 +186,19 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
get { return openState; }
|
||||
set
|
||||
{
|
||||
{
|
||||
openState = MathHelper.Clamp(value, 0.0f, 1.0f);
|
||||
#if CLIENT
|
||||
float size = IsHorizontal ? item.Rect.Width : item.Rect.Height;
|
||||
if (Math.Abs(lastConvexHullState - openState) * size < 5.0f) { return; }
|
||||
UpdateConvexHulls();
|
||||
lastConvexHullState = openState;
|
||||
//refresh convex hulls if the body of the door has moved by 5 pixels,
|
||||
//or if it becomes fully closed or fully open
|
||||
if (Math.Abs(lastConvexHullState - openState) * size > 5.0f ||
|
||||
(openState <= 0.0f && lastConvexHullState > 0.0f) ||
|
||||
(openState >= 1.0f && lastConvexHullState < 1.0f))
|
||||
{
|
||||
UpdateConvexHulls();
|
||||
lastConvexHullState = openState;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -523,11 +529,11 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
RefreshLinkedGap();
|
||||
#if CLIENT
|
||||
Vector2[] corners = GetConvexHullCorners(Rectangle.Empty);
|
||||
|
||||
convexHull = new ConvexHull(corners, Color.Black, item);
|
||||
if (Window != Rectangle.Empty) convexHull2 = new ConvexHull(corners, Color.Black, item);
|
||||
|
||||
convexHull = new ConvexHull(doorRect, IsHorizontal, item);
|
||||
if (Window != Rectangle.Empty)
|
||||
{
|
||||
convexHull2 = new ConvexHull(doorRect, IsHorizontal, item);
|
||||
}
|
||||
UpdateConvexHulls();
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user