Event ID wraparound fixes

This commit is contained in:
Regalis
2017-05-02 22:18:36 +03:00
parent 06db2fed86
commit d0b52d92fe
2 changed files with 7 additions and 9 deletions

View File

@@ -145,9 +145,9 @@ namespace Barotrauma.Networking
IServerSerializable entity = Entity.FindEntityByID(entityID) as IServerSerializable;
//skip the event if we've already received it or if the entity isn't found
if (thisEventID != lastReceivedID + 1 || entity == null)
if (thisEventID != (UInt16)(lastReceivedID + 1) || entity == null)
{
if (thisEventID != lastReceivedID + 1)
if (thisEventID != (UInt16)(lastReceivedID + 1))
{
DebugConsole.NewMessage("received msg " + thisEventID + " (waiting for "+ (lastReceivedID+1) + ")", thisEventID<lastReceivedID+1 ? Microsoft.Xna.Framework.Color.Yellow : Microsoft.Xna.Framework.Color.Red);
}