Unfail mcv deploy

This commit is contained in:
Paul Chote
2010-07-30 19:57:52 +12:00
parent ede160f1b6
commit 119f85dbf4
8 changed files with 104 additions and 126 deletions

View File

@@ -19,17 +19,14 @@ namespace OpenRA.Mods.RA.Activities
{
string actor = null;
int2 offset;
string[] sounds = null;
bool transferPercentage;
string[] sounds = null;
bool isCanceled;
public TransformIntoActor(string actor, int2 offset, bool transferHealthPercentage, string[] sounds)
public TransformIntoActor(string actor, int2 offset, string[] sounds)
{
this.actor = actor;
this.offset = offset;
this.sounds = sounds;
this.transferPercentage = transferHealthPercentage;
}
public IActivity NextActivity { get; set; }
@@ -47,11 +44,10 @@ namespace OpenRA.Mods.RA.Activities
Sound.PlayToPlayer(self.Owner, s, self.CenterLocation);
var a = w.CreateActor(actor, self.Location + offset, self.Owner);
var health = a.traits.GetOrDefault<Health>();
if (health != null)
{
health.TransferHPFromActor(a, self, transferPercentage);
}
var oldHealth = self.traits.GetOrDefault<Health>();
var newHealth = a.traits.GetOrDefault<Health>();
if (oldHealth != null && newHealth != null)
newHealth.HPFraction = oldHealth.HPFraction;
if (selected)
w.Selection.Add(w, a);

View File

@@ -25,11 +25,10 @@ namespace OpenRA.Mods.RA.Activities
var mcv = w.CreateActor("mcv", self.Location + new int2(1, 1), self.Owner);
var health = mcv.traits.GetOrDefault<Health>();
if (health != null)
{
health.TransferHPFromActor(mcv, self, true);
}
var oldHealth = self.traits.GetOrDefault<Health>();
var newHealth = mcv.traits.GetOrDefault<Health>();
if (oldHealth != null && newHealth != null)
newHealth.HPFraction = oldHealth.HPFraction;
mcv.traits.Get<Unit>().Facing = 96;