finished TraitDictionary. Refactored permanent actor-removal.

This commit is contained in:
Bob
2010-08-15 01:14:06 +12:00
committed by Chris Forbes
parent c0d0636e08
commit 5561ac458b
14 changed files with 102 additions and 71 deletions

View File

@@ -34,8 +34,8 @@ namespace OpenRA.Mods.RA.Activities
foreach (var t in target.TraitsImplementing<INotifyCapture>())
t.OnCapture(target, self, oldOwner, self.Owner);
w.Remove(self);
self.Destroy();
});
return NextActivity;
}

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Activities
foreach (var t in target.TraitsImplementing<IAcceptSpy>())
t.OnInfiltrate(target, self);
self.World.AddFrameEndTask(w => w.Remove(self));
self.Destroy();
return NextActivity;
}

View File

@@ -27,8 +27,8 @@ namespace OpenRA.Mods.RA.Activities
if (health.DamageState == DamageState.Undamaged)
return NextActivity;
target.InflictDamage(self, -health.MaxHP, null);
self.World.AddFrameEndTask(w => w.Remove(self));
target.InflictDamage(self, -health.MaxHP, null);
self.Destroy();
return NextActivity;
}

View File

@@ -48,11 +48,11 @@ namespace OpenRA.Mods.RA.Activities
self.World.AddFrameEndTask(w =>
{
var selected = w.Selection.Contains(self);
self.World.Remove(self);
self.Destroy();
foreach (var s in sounds)
Sound.PlayToPlayer(self.Owner, s, self.CenterLocation);
var init = new TypeDictionary
{
new LocationInit( self.Location + offset ),