Networking bugfixes & improvements:

- fixed server not sending kill-events when a monster dies
- some interpolation when correcting character positions
- physicsbody position lerping improvements
- sending AICharacter Dir instead of TargetDir
This commit is contained in:
Regalis
2016-03-09 16:49:56 +02:00
parent 37f70a1028
commit a1c728d207
13 changed files with 126 additions and 95 deletions
@@ -84,15 +84,19 @@ namespace Barotrauma
if (flip)
{
//targetDir = (movement.X > 0.0f) ? Direction.Right : Direction.Left;
if (targetMovement.X > 0.1f && targetMovement.X > Math.Abs(targetMovement.Y) * 0.5f)
if (!character.IsNetworkPlayer)
{
TargetDir = Direction.Right;
}
else if (targetMovement.X < -0.1f && targetMovement.X < -Math.Abs(targetMovement.Y) * 0.5f)
{
TargetDir = Direction.Left;
//targetDir = (movement.X > 0.0f) ? Direction.Right : Direction.Left;
if (targetMovement.X > 0.1f && targetMovement.X > Math.Abs(targetMovement.Y) * 0.5f)
{
TargetDir = Direction.Right;
}
else if (targetMovement.X < -0.1f && targetMovement.X < -Math.Abs(targetMovement.Y) * 0.5f)
{
TargetDir = Direction.Left;
}
}
}
else
{
@@ -117,7 +121,7 @@ namespace Barotrauma
if (TargetDir != dir)
{
if (flipTimer>1.0f)
if (flipTimer>1.0f || character.IsNetworkPlayer)
{
Flip();
if (flip) Mirror();