fix: Fixes static persistence of faction system (#1020)

This commit is contained in:
Kamron Batman 2022-05-15 12:45:51 -07:00 committed by GitHub
parent eee8494558
commit 7b619f23b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,14 +47,12 @@ public static class FactionSystem
writer.WriteEncodedInt(0); // version
var factions = Faction.Factions;
for (var i = 0; i < factions.Count; i++)
{
factions[i].State.Serialize(writer);
}
var towns = Town.Towns;
for (var i = 0; i < towns.Count; i++)
{
towns[i].State.Serialize(writer);
@ -65,13 +63,13 @@ public static class FactionSystem
{
var version = reader.ReadEncodedInt();
var count = reader.ReadEncodedInt();
var count = Faction.Factions.Count;
for (var i = 0; i < count; i++)
{
new FactionState(reader);
}
count = reader.ReadEncodedInt();
count = Town.Towns.Count;
for (var i = 0; i < count; i++)
{
new TownState(reader);