This commit is contained in:
Chris Forbes
2010-01-11 19:07:22 +13:00
parent 21bf3cd0e1
commit 5faa1ea724
9 changed files with 20 additions and 14 deletions

View File

@@ -25,9 +25,9 @@ namespace OpenRa.Game.Orders
var underCursor = Game.FindUnits(loc, loc)
.Where(a => a.Owner == Game.LocalPlayer
&& a.traits.Contains<Building>()
&& a.LegacyInfo.Selectable).FirstOrDefault();
&& a.traits.Contains<Selectable>()).FirstOrDefault();
var building = underCursor != null ? underCursor.LegacyInfo as LegacyBuildingInfo : null;
var building = underCursor != null ? underCursor.Info.Traits.Get<BuildingInfo>() : null;
if (building != null && !building.Unsellable)
yield return new Order("Sell", underCursor, null, int2.Zero, null);