Merge pull request #3389 from ScottNZ/infil

Infiltration code cleanup
This commit is contained in:
Matthias Mailänder
2013-06-14 00:08:24 -07:00
10 changed files with 65 additions and 55 deletions

View File

@@ -27,10 +27,7 @@ namespace OpenRA.Mods.RA.Activities
foreach (var t in target.Actor.TraitsImplementing<IAcceptInfiltrator>())
t.OnInfiltrate(target.Actor, self);
if (self.HasTrait<DontDestroyWhenInfiltrating>())
self.World.AddFrameEndTask(w => { if (!self.Destroyed) w.Remove(self); });
else
self.Destroy();
self.World.AddFrameEndTask(w => { if (!self.Destroyed) w.Remove(self); });
if (target.Actor.HasTrait<Building>())
Sound.PlayToPlayer(self.Owner, "bldginf1.aud");