presence of the trait is enough; don't need to check a legacy flag too.

This commit is contained in:
Chris Forbes
2009-12-28 13:31:08 +13:00
parent 650a0c333a
commit c5c1ec79ab
4 changed files with 12 additions and 15 deletions

View File

@@ -68,7 +68,6 @@ namespace OpenRa.Game.GameRules
public class InfantryInfo : MobileInfo
{
public readonly bool Crushable = true; // also on VehicleInfo, but with a different default
public readonly bool C4 = false;
public readonly bool FraidyCat = false;
public readonly bool Infiltrate = false;
@@ -80,7 +79,6 @@ namespace OpenRa.Game.GameRules
public class VehicleInfo : MobileInfo
{
public readonly bool Crushable = false;
public readonly bool Tracked = false;
public VehicleInfo(string name) : base(name) { }

View File

@@ -181,7 +181,7 @@
<Compile Include="Traits\Fake.cs" />
<Compile Include="Traits\Harvester.cs" />
<Compile Include="Traits\Helicopter.cs" />
<Compile Include="Traits\Infantry.cs" />
<Compile Include="Traits\SquishByTank.cs" />
<Compile Include="Traits\Plane.cs" />
<Compile Include="Traits\ProductionQueue.cs" />
<Compile Include="Traits\ProductionSurround.cs" />

View File

@@ -5,10 +5,10 @@ using OpenRa.Game.GameRules;
namespace OpenRa.Game.Traits
{
class Infantry : ICrushable
class SquishByTank : ICrushable
{
readonly Actor self;
public Infantry(Actor self)
public SquishByTank(Actor self)
{
this.self = self;
}
@@ -26,7 +26,6 @@ namespace OpenRa.Game.Traits
public bool IsCrushableBy(UnitMovementType umt, Player player)
{
if (player == Game.LocalPlayer) return false;
if (!(self.Info as InfantryInfo).Crushable) return false;
switch (umt)
{
case UnitMovementType.Track: return true;