Skip to content

Commit a1736f2

Browse files
committed
Fix bug where cloned buildings shared their lit cells lists with their original buildings
1 parent b2358f7 commit a1736f2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/TSMapEditor/Models/Map.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ private void ReloadSections()
333333

334334
// Refresh light posts in case they got their INI config changed - saves the user
335335
// from having to reload the map to refresh lighting changes
336+
// Lighting.ReadFromIniFile will afterwards refresh lighting of all cells, so we don't
337+
// need to do it separately for cells lit by the building
336338
Rules.BuildingTypes.ForEach(bt => initializer.ReadObjectTypePropertiesFromINI(bt, LoadedINI));
337339
Structures.ForEach(s => s.LightTiles(Tiles));
338340

src/TSMapEditor/Models/Structure.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ public override Structure Clone()
337337

338338
clone.UpdatePowerUpAnims();
339339

340+
clone.LitTiles = new List<MapTile>();
341+
340342
return clone;
341343
}
342344
}

0 commit comments

Comments
 (0)