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
|
|
@ -257,10 +257,11 @@ namespace Server.Mobiles
|
|||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
List<IEntity> entities = new (Items);
|
||||
List<IEntity> entities = [..Items];
|
||||
entities.AddRange(reader.ReadEntityList<Mobile>());
|
||||
|
||||
m_Mobiles = new List<Mobile>(); // This cannot be null in case it is referenced before disposing
|
||||
m_Table = new Dictionary<Type, IEntity>();
|
||||
|
||||
Timer.StartTimer(() =>
|
||||
{
|
||||
|
|
@ -268,19 +269,17 @@ namespace Server.Mobiles
|
|||
{
|
||||
entity.Delete();
|
||||
}
|
||||
|
||||
if (m_Cache == null)
|
||||
{
|
||||
m_Cache = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
m_Table = new Dictionary<Type, IEntity>();
|
||||
|
||||
if (m_Cache == null)
|
||||
{
|
||||
m_Cache = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue