Fixes
This commit is contained in:
@@ -1044,7 +1044,7 @@ namespace Barotrauma
|
||||
else if (collisionsDisabled)
|
||||
{
|
||||
//set the position of the ragdoll to make sure limbs don't get stuck inside walls when re-enabling collisions
|
||||
SetPosition(MainLimb.SimPosition, true);
|
||||
SetPosition(collider.SimPosition, true);
|
||||
|
||||
UpdateCollisionCategories();
|
||||
collisionsDisabled = false;
|
||||
@@ -1062,16 +1062,20 @@ namespace Barotrauma
|
||||
PosInfo serverPos = character.MemPos.Last();
|
||||
|
||||
int localPosIndex = character.MemLocalPos.FindIndex(m => m.ID == serverPos.ID);
|
||||
if (localPosIndex == -1) return;
|
||||
|
||||
PosInfo localPos = character.MemLocalPos[localPosIndex];
|
||||
|
||||
if (Vector2.Distance(localPos.Position, serverPos.Position) > 0.1f)
|
||||
if (localPosIndex > -1)
|
||||
{
|
||||
//collider.SetTransform(collider.SimPosition + (pos.Position - remotePos), collider.Rotation);
|
||||
collider.SetTransform(serverPos.Position, collider.Rotation);
|
||||
PosInfo localPos = character.MemLocalPos[localPosIndex];
|
||||
|
||||
if (Vector2.Distance(localPos.Position, serverPos.Position) > 0.1f)
|
||||
{
|
||||
//collider.SetTransform(collider.SimPosition + (pos.Position - remotePos), collider.Rotation);
|
||||
collider.SetTransform(serverPos.Position, collider.Rotation);
|
||||
// character.MemLocalPos.RemoveRange(localPosIndex, character.MemLocalPos.Count - localPosIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (character.MemLocalPos.Count > 120) character.MemLocalPos.RemoveRange(0, character.MemLocalPos.Count - 120);
|
||||
character.MemPos.Clear();
|
||||
}
|
||||
|
||||
@@ -1857,14 +1857,14 @@ namespace Barotrauma
|
||||
if (this == c.Character)
|
||||
{
|
||||
//length of the message
|
||||
msg.Write((byte)(4+4+4+4));
|
||||
msg.Write((byte)(4+4+4+1));
|
||||
msg.Write(true);
|
||||
msg.Write((UInt32)(LastNetworkUpdateID - memInput.Count));
|
||||
}
|
||||
else
|
||||
{
|
||||
//length of the message
|
||||
msg.Write((byte)(4+4+4));
|
||||
msg.Write((byte)(4+4+1));
|
||||
msg.Write(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -646,15 +646,6 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Character character in Character.CharacterList)
|
||||
{
|
||||
if (character is AICharacter) continue;
|
||||
|
||||
outmsg.Write((byte)ServerNetObject.CHARACTER_POSITION);
|
||||
character.ServerWrite(outmsg, c);
|
||||
outmsg.WritePadBits();
|
||||
}
|
||||
|
||||
if (Item.Spawner.NetStateID > c.lastRecvEntitySpawnID)
|
||||
{
|
||||
outmsg.Write((byte)ServerNetObject.ENTITY_SPAWN);
|
||||
@@ -669,6 +660,14 @@ namespace Barotrauma.Networking
|
||||
outmsg.WritePadBits();
|
||||
}
|
||||
|
||||
foreach (Character character in Character.CharacterList)
|
||||
{
|
||||
if (character is AICharacter) continue;
|
||||
|
||||
outmsg.Write((byte)ServerNetObject.CHARACTER_POSITION);
|
||||
character.ServerWrite(outmsg, c);
|
||||
outmsg.WritePadBits();
|
||||
}
|
||||
|
||||
outmsg.Write((byte)ServerNetObject.END_OF_MESSAGE);
|
||||
server.SendMessage(outmsg, c.Connection, NetDeliveryMethod.Unreliable);
|
||||
|
||||
Reference in New Issue
Block a user