Fixes to unconscious character pos syncing:

- main limb is anchored to collider
- server ignores inputs from unconscious characters and doesn't freeze them
- using timestamp-based interpolation on the client's own character instead of IDs
This commit is contained in:
Regalis
2017-01-03 23:49:37 +02:00
parent 1eea373117
commit bb685019a2
5 changed files with 81 additions and 58 deletions

View File

@@ -59,7 +59,7 @@ namespace Barotrauma
ColliderIndex = Crouching ? 1 : 0;
if (!Crouching && ColliderIndex == 1) Crouching = true;
if (character.IsDead || character.IsUnconscious || stunTimer > 0.0f)
if (!character.AllowMovement)
{
levitatingCollider = false;
Collider.FarseerBody.FixedRotation = false;
@@ -921,13 +921,15 @@ namespace Barotrauma
target.AnimController.IgnorePlatforms = IgnorePlatforms;
if (target.Stun > 0.0f || target.IsUnconscious || target.IsDead)
if (!target.AllowMovement)
{
target.AnimController.TargetMovement = TargetMovement;
}
else if (target is AICharacter)
{
target.AnimController.TargetMovement = Vector2.Lerp(target.AnimController.TargetMovement, (character.SimPosition + Vector2.UnitX * Dir) - target.SimPosition, 0.5f);
target.AnimController.TargetMovement = Vector2.Lerp(
target.AnimController.TargetMovement,
(character.SimPosition + Vector2.UnitX * Dir) - target.SimPosition, 0.5f);
}
}