Setting ragdoll position without limbs going through walls, rotating entire ragdoll, using combined network messages client->server, fixed fabricators
This commit is contained in:
@@ -109,7 +109,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public float Average()
|
||||
{
|
||||
return values.Average();
|
||||
return values.Length == 0 ? 0.0f : values.Average();
|
||||
}
|
||||
|
||||
public void Update(float newValue)
|
||||
@@ -133,11 +133,13 @@ namespace Barotrauma.Networking
|
||||
graphMaxVal = (float)maxVal;
|
||||
}
|
||||
|
||||
GUI.DrawRectangle(spriteBatch, rect, Color.White);
|
||||
|
||||
if (values.Length == 0) return;
|
||||
|
||||
float lineWidth = (float)rect.Width / (float)(values.Length - 2);
|
||||
float yScale = (float)rect.Height / graphMaxVal;
|
||||
|
||||
GUI.DrawRectangle(spriteBatch, rect, Color.White);
|
||||
|
||||
Vector2 prevPoint = new Vector2(rect.Right, rect.Bottom - (values[1] + (values[0] - values[1]) * xOffset) * yScale);
|
||||
|
||||
float currX = rect.Right - ((xOffset - 1.0f) * lineWidth);
|
||||
|
||||
Reference in New Issue
Block a user