This commit is contained in:
Kamron Batman 2020-04-10 14:41:39 -07:00 committed by GitHub
parent 4f75cd9251
commit 5b5bfeb4b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1696 additions and 728 deletions

File diff suppressed because it is too large Load diff

View file

@ -475,22 +475,12 @@ namespace Server
public void Write(List<Item> list)
{
Write(list, false);
WriteItemList(list);
}
public void Write(List<Item> list, bool tidy)
{
if (tidy)
for (int i = 0; i < list.Count;)
if (list[i].Deleted)
list.RemoveAt(i);
else
++i;
Write(list.Count);
for (int i = 0; i < list.Count; ++i)
Write(list[i]);
WriteItemList(list, tidy);
}
public void WriteItemList<T>(List<T> list) where T : Item
@ -502,7 +492,7 @@ namespace Server
{
if (tidy)
for (int i = 0; i < list.Count;)
if (list[i].Deleted)
if (list[i]?.Deleted != false)
list.RemoveAt(i);
else
++i;

View file

@ -440,22 +440,12 @@ namespace Server
public void Write(List<Item> list)
{
Write(list, false);
WriteItemList(list);
}
public void Write(List<Item> list, bool tidy)
{
if (tidy)
for (int i = 0; i < list.Count;)
if (list[i].Deleted)
list.RemoveAt(i);
else
++i;
Write(list.Count);
for (int i = 0; i < list.Count; ++i)
Write(list[i]);
WriteItemList(list, tidy);
}
public void WriteItemList<T>(List<T> list) where T : Item