Cherry-picked 0ff9a3d (more ragdoll optimization)

This commit is contained in:
Joonas Rikkonen
2018-06-20 15:55:23 +03:00
parent 15331c58bb
commit e7e7d32123
2 changed files with 21 additions and 29 deletions
@@ -783,12 +783,6 @@ namespace Barotrauma
public override void Update(float deltaTime, Camera cam)
{
if (Level.Loaded != null && WorldPosition.Y < Level.MaxEntityDepth)
{
Spawner.AddToRemoveQueue(this);
return;
}
ApplyStatusEffects(ActionType.Always, deltaTime, null);
foreach (ItemComponent ic in components)
@@ -851,6 +845,12 @@ namespace Barotrauma
MathHelper.Clamp(body.LinearVelocity.X, -MaxVel, MaxVel),
MathHelper.Clamp(body.LinearVelocity.Y, -MaxVel, MaxVel));
}
if (CurrentHull == null && body.SimPosition.Y < ConvertUnits.ToSimUnits(Level.MaxEntityDepth))
{
Spawner.AddToRemoveQueue(this);
return;
}
}
UpdateNetPosition();