Server clears EntityEventManager before starting a new round, not just when ending it (fixes events breaking during the next round if an item created an event when unloading the previous sub) + some additional error checks
This commit is contained in:
@@ -36,6 +36,14 @@ namespace Barotrauma.Networking
|
||||
tempBuffer.LengthBytes < 256,
|
||||
"Maximum EntityEvent size exceeded when serializing \""+e.Entity+"\"!");
|
||||
|
||||
#if DEBUG
|
||||
if (Entity.FindEntityByID(e.Entity.ID) != e.Entity)
|
||||
{
|
||||
DebugConsole.ThrowError("Error in NetEntityEventManager.Write (FindEntityByID(e.Entity.ID) != e.Entity)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
msg.Write((UInt16)e.Entity.ID);
|
||||
msg.Write((byte)tempBuffer.LengthBytes);
|
||||
msg.Write(tempBuffer);
|
||||
|
||||
Reference in New Issue
Block a user