fix actor leak bug

This commit is contained in:
Bob
2010-09-09 01:47:26 +12:00
parent c3fa9f7aa8
commit f70a6aafb1
3 changed files with 39 additions and 43 deletions

View File

@@ -52,11 +52,6 @@ namespace OpenRA.Mods.Cnc
});
var cargo = a.Trait<Cargo>();
var newUnit = self.World.CreateActor(false, producee.Name, new TypeDictionary
{
new OwnerInit( self.Owner ),
});
cargo.Load(a, newUnit);
a.QueueActivity(new Fly(self.Location + new int2(6,0)));
a.QueueActivity(new Land(Target.FromActor(self)));
a.QueueActivity(new CallFunc(() =>
@@ -64,7 +59,7 @@ namespace OpenRA.Mods.Cnc
if (self.IsDead())
return;
rb.PlayCustomAnimRepeating(self, "idle");
self.World.AddFrameEndTask(ww => DoProduction(self, cargo.Unload(self), exit));
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit));
}));
a.QueueActivity(new Fly(endPos));
a.QueueActivity(new RemoveSelf());