Unique event IDs start from 1 (otherwise the server/clients will think event #0 has been already received)
This commit is contained in:
@@ -96,7 +96,7 @@ namespace Barotrauma.Networking
|
|||||||
if (!uniqueEvents.Any(e => e.IsDuplicate(newEvent)))
|
if (!uniqueEvents.Any(e => e.IsDuplicate(newEvent)))
|
||||||
{
|
{
|
||||||
//create a copy of the event and give it a new ID
|
//create a copy of the event and give it a new ID
|
||||||
var uniqueEvent = new ServerEntityEvent(entity, (UInt16)uniqueEvents.Count);
|
var uniqueEvent = new ServerEntityEvent(entity, (UInt16)(uniqueEvents.Count + 1));
|
||||||
uniqueEvent.SetData(extraData);
|
uniqueEvent.SetData(extraData);
|
||||||
|
|
||||||
uniqueEvents.Add(uniqueEvent);
|
uniqueEvents.Add(uniqueEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user