slim down the ore capacity update
This commit is contained in:
@@ -110,12 +110,9 @@ namespace OpenRA
|
||||
if (PowerProvided - PowerDrained < 0)
|
||||
if (PowerProvided - PowerDrained != oldBalance)
|
||||
GiveAdvice(World.WorldActor.Info.Traits.Get<EvaAlertsInfo>().LowPower);
|
||||
}
|
||||
|
||||
public float GetSiloFullness()
|
||||
{
|
||||
return (float)Ore / OreCapacity;
|
||||
}
|
||||
}
|
||||
|
||||
public float GetSiloFullness() { return (float)Ore / OreCapacity; }
|
||||
|
||||
public PowerState GetPowerState()
|
||||
{
|
||||
@@ -124,14 +121,6 @@ namespace OpenRA
|
||||
return PowerState.Critical;
|
||||
}
|
||||
|
||||
void UpdateOreCapacity()
|
||||
{
|
||||
OreCapacity = World.Queries.OwnedBy[this]
|
||||
.Where(a => a.traits.Contains<StoresOre>())
|
||||
.Select(a => a.Info.Traits.Get<StoresOreInfo>())
|
||||
.Sum(b => b.Capacity);
|
||||
}
|
||||
|
||||
void GiveAdvice(string advice)
|
||||
{
|
||||
// todo: store the condition or something.
|
||||
@@ -171,8 +160,10 @@ namespace OpenRA
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
UpdatePower();
|
||||
UpdateOreCapacity();
|
||||
UpdatePower();
|
||||
|
||||
OreCapacity = World.Queries.OwnedBy[this].WithTrait<StoresOre>()
|
||||
.Sum(a => a.Actor.Info.Traits.Get<StoresOreInfo>().Capacity);
|
||||
|
||||
var totalMoney = Cash + Ore;
|
||||
var diff = Math.Abs(totalMoney - DisplayCash);
|
||||
|
||||
Reference in New Issue
Block a user