Vehicle husks should not appear on water

This commit is contained in:
Curtis S
2011-08-30 20:55:27 -06:00
parent 29b32dd656
commit 3d48c454dc

View File

@@ -43,6 +43,14 @@ namespace OpenRA.Mods.RA
new SkipMakeAnimsInit()
};
// Allows the husk to drag to its final position
var mobile = self.TraitOrDefault<Mobile>();
if (mobile != null)
{
if (!mobile.CanEnterCell(self.Location, self, false)) return;
td.Add(new HuskSpeedInit(mobile.MovementSpeedForCell(self, self.Location)));
}
var facing = self.TraitOrDefault<IFacing>();
if (facing != null)
td.Add(new FacingInit( facing.Facing ));
@@ -51,11 +59,6 @@ namespace OpenRA.Mods.RA
if (turreted != null)
td.Add( new TurretFacingInit(turreted.turretFacing) );
// Allows the husk to drag to its final position
var mobile = self.TraitOrDefault<Mobile>();
if (mobile != null)
td.Add(new HuskSpeedInit(mobile.MovementSpeedForCell(self, self.Location)));
var huskActor = self.TraitsImplementing<IHuskModifier>()
.Select(ihm => ihm.HuskActor(self))
.FirstOrDefault(a => a != null);