Fixed another off-by-one error in EntitySpawner ID comparisons, clients reset their ChatMessage ID when (re)connecting to the server
This commit is contained in:
@@ -214,7 +214,7 @@ namespace Barotrauma
|
||||
ushort entityId = message.ReadUInt16();
|
||||
|
||||
var entity = Entity.FindEntityByID(entityId);
|
||||
if (entity == null || NetIdUtils.IdMoreRecent(NetStateID,(UInt16)(ID - entityCount + i))) continue; //already removed
|
||||
if (entity == null || NetIdUtils.IdMoreRecent((UInt16)(NetStateID - 1), (UInt16)(ID - entityCount + i))) continue; //already removed
|
||||
|
||||
entity.Remove();
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
myCharacter = Character.Controlled;
|
||||
ChatMessage.LastID = 0;
|
||||
|
||||
// Create new instance of configs. Parameter is "application Id". It has to be same on client and server.
|
||||
NetPeerConfiguration config = new NetPeerConfiguration("barotrauma");
|
||||
|
||||
Reference in New Issue
Block a user