fix: Fixes infinite loop in BinaryFileWriter (#1792)
### Summary - Fixes infinite loop with binary file writer - Removes extra buffer copying with binary file writer - Removes storing type counts during world save file writing - Fixes display cache self-deletion warning during world load
This commit is contained in:
parent
0011db7f47
commit
9f1f314077
6 changed files with 50 additions and 25 deletions
|
|
@ -28,12 +28,9 @@ public static class EntityPersistence
|
|||
IIndexInfo<I> indexInfo,
|
||||
Dictionary<I, T> entities,
|
||||
string savePath,
|
||||
ConcurrentQueue<Type> types,
|
||||
out Dictionary<string, int> counts
|
||||
ConcurrentQueue<Type> types
|
||||
) where T : class, ISerializable
|
||||
{
|
||||
counts = new Dictionary<string, int>();
|
||||
|
||||
var typeName = indexInfo.TypeName;
|
||||
|
||||
var path = Path.Combine(savePath, typeName);
|
||||
|
|
@ -61,12 +58,6 @@ public static class EntityPersistence
|
|||
e.SerializeTo(bin);
|
||||
|
||||
idx.Write((int)(bin.Position - start));
|
||||
|
||||
var type = e.GetType().FullName;
|
||||
if (type != null)
|
||||
{
|
||||
counts[type] = (counts.TryGetValue(type, out var count) ? count : 0) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue