Unique event IDs start from 1 (otherwise the server/clients will think event #0 has been already received)

This commit is contained in:
Regalis
2017-05-02 22:21:58 +03:00
parent d0b52d92fe
commit d1c633385b

View File

@@ -96,7 +96,7 @@ namespace Barotrauma.Networking
if (!uniqueEvents.Any(e => e.IsDuplicate(newEvent)))
{
//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);
uniqueEvents.Add(uniqueEvent);