fixed Building.unitInfo

This commit is contained in:
Bob
2010-01-12 20:18:36 +13:00
parent d5d6812e07
commit 4a004eda0f
9 changed files with 40 additions and 38 deletions

View File

@@ -39,7 +39,6 @@ namespace OpenRa.Game.Traits
class Building : INotifyDamage, IResolveOrder, ITick
{
readonly Actor self;
[Obsolete] public readonly LegacyBuildingInfo unitInfo;
public readonly BuildingInfo Info;
[Sync]
bool isRepairing = false;
@@ -53,7 +52,6 @@ namespace OpenRa.Game.Traits
{
this.self = self;
Info = self.Info.Traits.Get<BuildingInfo>();
unitInfo = (LegacyBuildingInfo)self.LegacyInfo;
self.CenterLocation = Game.CellSize
* ((float2)self.Location + .5f * (float2)Info.Dimensions);
}

View File

@@ -24,8 +24,8 @@ namespace OpenRa.Game.Traits
{
if( order.OrderString == "DeployMcv" )
{
var factBuildingInfo = (LegacyBuildingInfo)Rules.UnitInfo[ "fact" ];
if( Game.CanPlaceBuilding( factBuildingInfo, self.Location - new int2( 1, 1 ), self, false ) )
var factBuildingInfo = Rules.NewUnitInfo[ "fact" ].Traits.Get<BuildingInfo>();
if( Game.CanPlaceBuilding( "fact", factBuildingInfo, self.Location - new int2( 1, 1 ), self, false ) )
{
self.CancelActivity();
self.QueueActivity( new Turn( 96 ) );