Fixed exceptions in ServerEntityEventManager if there are no clients on the server, clients who are in the lobby can't prevent outdated EntityEvents from being removed
This commit is contained in:
@@ -109,8 +109,11 @@ namespace Barotrauma.Networking
|
|||||||
bufferedEvent.IsProcessed = true;
|
bufferedEvent.IsProcessed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clients.Count > 0)
|
||||||
|
{
|
||||||
lastSentToAll = clients[0].lastRecvEntityEventID;
|
lastSentToAll = clients[0].lastRecvEntityEventID;
|
||||||
clients.ForEach(c => { if (c.lastRecvEntityEventID < lastSentToAll) lastSentToAll = c.lastRecvEntityEventID; });
|
clients.ForEach(c => { if (c.inGame) lastSentToAll = Math.Min(lastSentToAll, c.lastRecvEntityEventID); });
|
||||||
|
}
|
||||||
|
|
||||||
bufferedEvents.RemoveAll(b => b.IsProcessed);
|
bufferedEvents.RemoveAll(b => b.IsProcessed);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user