Remove lazy loading of binary map data.
This commit is contained in:
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Resources = self.TraitsImplementing<ResourceType>()
|
||||
.ToDictionary(r => r.Info.ResourceType, r => r);
|
||||
|
||||
Map.MapResources.Value.CellEntryChanged += UpdateCell;
|
||||
Map.Resources.CellEntryChanged += UpdateCell;
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void UpdateCell(CPos cell)
|
||||
{
|
||||
var uv = cell.ToMPos(Map);
|
||||
var tile = Map.MapResources.Value[uv];
|
||||
var tile = Map.Resources[uv];
|
||||
|
||||
var t = Tiles[cell];
|
||||
if (t.Density > 0)
|
||||
@@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// Set density based on the number of neighboring resources
|
||||
var adjacent = 0;
|
||||
var type = Tiles[c].Type;
|
||||
var resources = Map.MapResources.Value;
|
||||
var resources = Map.Resources;
|
||||
for (var u = -1; u < 2; u++)
|
||||
{
|
||||
for (var v = -1; v < 2; v++)
|
||||
@@ -205,7 +205,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var kv in spriteLayers.Values)
|
||||
kv.Dispose();
|
||||
|
||||
Map.MapResources.Value.CellEntryChanged -= UpdateCell;
|
||||
Map.Resources.CellEntryChanged -= UpdateCell;
|
||||
|
||||
disposed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user