Fix D2kEditorResourceLayer starting NetWorth
This commit is contained in:
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
readonly Dictionary<PaletteReference, TerrainSpriteLayer> spriteLayers = new Dictionary<PaletteReference, TerrainSpriteLayer>();
|
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)
|
public EditorResourceLayer(Actor self)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,10 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Graphics;
|
|
||||||
using OpenRA.Mods.Common.Traits;
|
using OpenRA.Mods.Common.Traits;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
@@ -42,8 +39,12 @@ namespace OpenRA.Mods.D2k.Traits
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NetWorth -= t.Density * t.Type.Info.ValuePerUnit;
|
||||||
|
|
||||||
t.Density = ResourceDensityAt(c);
|
t.Density = ResourceDensityAt(c);
|
||||||
|
|
||||||
|
NetWorth += t.Density * t.Type.Info.ValuePerUnit;
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
var clear = FindClearSides(t.Type, c);
|
var clear = FindClearSides(t.Type, c);
|
||||||
if (clear == ClearSides.None)
|
if (clear == ClearSides.None)
|
||||||
|
|||||||
Reference in New Issue
Block a user