renamed Info to LegacyInfo, marked Obsolete. added NewUnitInfo ref as Info.
This commit is contained in:
@@ -29,7 +29,7 @@ namespace OpenRa.Game.Traits
|
||||
public Building(Actor self)
|
||||
{
|
||||
this.self = self;
|
||||
unitInfo = (LegacyBuildingInfo)self.Info;
|
||||
unitInfo = (LegacyBuildingInfo)self.LegacyInfo;
|
||||
self.CenterLocation = Game.CellSize
|
||||
* ((float2)self.Location + .5f * (float2)unitInfo.Dimensions);
|
||||
}
|
||||
@@ -84,8 +84,8 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
if (remainingTicks == 0)
|
||||
{
|
||||
var costPerHp = (Rules.General.URepairPercent * self.Info.Cost) / self.Info.Strength;
|
||||
var hpToRepair = Math.Min(Rules.General.URepairStep, self.Info.Strength - self.Health);
|
||||
var costPerHp = (Rules.General.URepairPercent * self.LegacyInfo.Cost) / self.LegacyInfo.Strength;
|
||||
var hpToRepair = Math.Min(Rules.General.URepairStep, self.LegacyInfo.Strength - self.Health);
|
||||
var cost = (int)Math.Ceiling(costPerHp * hpToRepair);
|
||||
if (!self.Owner.TakeCash(cost))
|
||||
{
|
||||
@@ -95,7 +95,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
Game.world.AddFrameEndTask(w => w.Add(new RepairIndicator(self)));
|
||||
self.InflictDamage(self, -hpToRepair, Rules.WarheadInfo["Super"]);
|
||||
if (self.Health == self.Info.Strength)
|
||||
if (self.Health == self.LegacyInfo.Strength)
|
||||
{
|
||||
isRepairing = false;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user