Skip to content

Commit

Permalink
"repaired" digesters persist through saves
Browse files Browse the repository at this point in the history
  • Loading branch information
ameliajmoser committed Mar 11, 2024
1 parent 0132e8a commit 7c5ae54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/Code/Building/BuildingPersistence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ unsafe void ISaveStateChunkObject.Read(object self, ref ByteReader reader, SaveS
record.AuxComponentData = blockCopy;

if (record.Type == BuildingType.Storage || record.Type == BuildingType.Digester) {
int currIdx = record.TileIndex;
// remove any existing spawnrecord at this index
world.Spawns.QueuedBuildings.RemoveWhere(p => p.TileIndex == currIdx);
world.Spawns.QueuedBuildings.PushBack(new SpawnRecord<BuildingSpawnData>() {
TileIndex = (ushort) record.TileIndex,
Data = new BuildingSpawnData() {
Expand Down

0 comments on commit 7c5ae54

Please sign in to comment.