more fixes
This commit is contained in:
@@ -84,9 +84,8 @@ namespace OpenRa.Game
|
||||
{
|
||||
OreCapacity = Game.world.Actors
|
||||
.Where(a => a.Owner == this && a.traits.Contains<StoresOre>())
|
||||
.Select(a => a.LegacyInfo as LegacyBuildingInfo)
|
||||
.Where(b => b != null)
|
||||
.Sum(b => b.Storage);
|
||||
.Select(a => a.Info.Traits.Get<StoresOreInfo>())
|
||||
.Sum(b => b.Capacity);
|
||||
}
|
||||
|
||||
void GiveAdvice(string advice)
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
public bool IsFull(Actor self)
|
||||
{
|
||||
return cargo.Count == self.LegacyInfo.Passengers;
|
||||
return cargo.Count == self.Info.Traits.Get<CargoInfo>().Passengers;
|
||||
}
|
||||
|
||||
public bool IsEmpty(Actor self)
|
||||
@@ -65,7 +65,8 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
public IEnumerable<PipType> GetPips( Actor self )
|
||||
{
|
||||
for (var i = 0; i < self.Info.Traits.Get<CargoInfo>().Passengers; i++)
|
||||
var numPips = self.Info.Traits.Get<CargoInfo>().Passengers;
|
||||
for (var i = 0; i < numPips; i++)
|
||||
if (i >= cargo.Count)
|
||||
yield return PipType.Transparent;
|
||||
else
|
||||
|
||||
@@ -86,12 +86,12 @@ namespace OpenRa.Game.Traits
|
||||
}
|
||||
|
||||
// Cancel existing primaries
|
||||
foreach (var p in (self.LegacyInfo as LegacyBuildingInfo).Produces)
|
||||
foreach (var p in self.Info.Traits.Get<ProductionInfo>().Produces)
|
||||
{
|
||||
foreach (var b in Game.world.Actors.Where(x => x.traits.Contains<Production>()
|
||||
&& x.Owner == self.Owner
|
||||
&& x.traits.Get<Production>().IsPrimary == true
|
||||
&& (x.LegacyInfo as LegacyBuildingInfo).Produces.Contains(p)))
|
||||
&& (x.Info.Traits.Get<ProductionInfo>().Produces.Contains(p))))
|
||||
{
|
||||
b.traits.Get<Production>().SetPrimaryProducer(b, false);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
void DoBib(Actor self, bool isRemove)
|
||||
{
|
||||
var buildingInfo = self.traits.Get<Building>().unitInfo;
|
||||
var buildingInfo = self.Info.Traits.Get<BuildingInfo>();
|
||||
if (buildingInfo.Bib)
|
||||
{
|
||||
var size = buildingInfo.Dimensions.X;
|
||||
|
||||
Reference in New Issue
Block a user