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