From bb91c8ce757c7046e2335341fe84a1a4e7c18de7 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 29 Jun 2017 21:21:37 +0300 Subject: [PATCH] Fixed occasional "trying to read past the buffer size" errors when reading messages from the clients --- Barotrauma/Source/Characters/CharacterNetworking.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Barotrauma/Source/Characters/CharacterNetworking.cs b/Barotrauma/Source/Characters/CharacterNetworking.cs index 83ef5b208..065563c40 100644 --- a/Barotrauma/Source/Characters/CharacterNetworking.cs +++ b/Barotrauma/Source/Characters/CharacterNetworking.cs @@ -258,7 +258,6 @@ namespace Barotrauma msg.WriteRangedInteger(0, 2, 2); break; } - msg.WritePadBits(); } else { @@ -285,6 +284,7 @@ namespace Barotrauma } } } + msg.WritePadBits(); } public virtual void ServerRead(ClientNetObject type, NetBuffer msg, Client c) { @@ -383,12 +383,10 @@ namespace Barotrauma Kill(lastAttackCauseOfDeath); } break; - } - - msg.ReadPadBits(); break; } + msg.ReadPadBits(); } public virtual void ServerWrite(NetBuffer msg, Client c, object[] extraData = null)