Aiming is disabled when unconscious/stunned, the range of fire lightsources isn't randomized to reduce the amount of required convexhull updates

This commit is contained in:
Regalis
2016-05-19 19:49:31 +03:00
parent a477dad1b2
commit 7113a154fe
3 changed files with 4 additions and 2 deletions
@@ -50,7 +50,7 @@ namespace Barotrauma
} }
newTargetTimer = currentTarget == null ? 5.0f : 10.0f; newTargetTimer = currentTarget == null ? 5.0f : 15.0f;
} }
newTargetTimer -= deltaTime; newTargetTimer -= deltaTime;
@@ -973,6 +973,8 @@ namespace Barotrauma
{ {
Holdable holdable = item.GetComponent<Holdable>(); Holdable holdable = item.GetComponent<Holdable>();
if (character.IsUnconscious || character.Stun > 0.0f) aim = false;
//calculate the handle positions //calculate the handle positions
Matrix itemTransfrom = Matrix.CreateRotationZ(item.body.Rotation); Matrix itemTransfrom = Matrix.CreateRotationZ(item.body.Rotation);
Vector2[] transformedHandlePos = new Vector2[2]; Vector2[] transformedHandlePos = new Vector2[2];
+1 -1
View File
@@ -206,7 +206,7 @@ namespace Barotrauma
LimitSize(); LimitSize();
lightSource.Range = Math.Max(size.X, size.Y) * Rand.Range(8.0f, 10.0f) / 2.0f; lightSource.Range = Math.Max(size.X, size.Y) * 10.0f / 2.0f;
lightSource.Color = new Color(1.0f, 0.45f, 0.3f) * Rand.Range(0.8f, 1.0f); lightSource.Color = new Color(1.0f, 0.45f, 0.3f) * Rand.Range(0.8f, 1.0f);
lightSource.Position = position; lightSource.Position = position;