Fix D2kEditorResourceLayer starting NetWorth

This commit is contained in:
Pavel Penev
2015-10-22 01:10:16 +03:00
parent 1e890a921f
commit f7a63ab2f8
2 changed files with 5 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
readonly Dictionary<PaletteReference, TerrainSpriteLayer> spriteLayers = new Dictionary<PaletteReference, TerrainSpriteLayer>();
public int NetWorth { get; private set; }
public int NetWorth { get; protected set; }
public EditorResourceLayer(Actor self)
{

View File

@@ -8,10 +8,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
@@ -42,8 +39,12 @@ namespace OpenRA.Mods.D2k.Traits
return t;
}
NetWorth -= t.Density * t.Type.Info.ValuePerUnit;
t.Density = ResourceDensityAt(c);
NetWorth += t.Density * t.Type.Info.ValuePerUnit;
int index;
var clear = FindClearSides(t.Type, c);
if (clear == ClearSides.None)