Fixed crashing if a message has no room for any entityevents (TODO: make sure item position updates don't take up all the space in the messages and prevent entityevents from being sent)
This commit is contained in:
@@ -65,9 +65,12 @@ namespace Barotrauma.Networking
|
||||
eventCount++;
|
||||
}
|
||||
|
||||
msg.Write(eventsToSync[0].ID);
|
||||
msg.Write((byte)eventCount);
|
||||
msg.Write(tempBuffer);
|
||||
if (eventCount > 0)
|
||||
{
|
||||
msg.Write(eventsToSync[0].ID);
|
||||
msg.Write((byte)eventCount);
|
||||
msg.Write(tempBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void WriteEvent(NetBuffer buffer, NetEntityEvent entityEvent, Client recipient = null)
|
||||
|
||||
Reference in New Issue
Block a user