Infiltration code cleanup

This commit is contained in:
ScottNZ
2013-06-14 18:58:39 +12:00
parent e7fcb758e3
commit 5334589922
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");