fix #18 -- harvs built at weap choose a proc when trying to return now

This commit is contained in:
Chris Forbes
2010-08-12 19:54:37 +12:00
parent 4328fbc350
commit df19163ce5
2 changed files with 11 additions and 6 deletions

View File

@@ -25,11 +25,16 @@ namespace OpenRA.Mods.RA.Activities
{
if( NextActivity != null )
return NextActivity;
var proc = self.traits.Get<Harvester>().LinkedProc;
if (proc == null)
return new Wait(10) { NextActivity = this };
var harv = self.traits.Get<Harvester>();
if (harv.LinkedProc == null)
harv.ChooseNewProc(self, null);
if (harv.LinkedProc == null)
return new Wait(25) { NextActivity = this };
var proc = harv.LinkedProc;
if( self.Location != proc.Location + proc.traits.Get<IAcceptOre>().DeliverOffset )
{

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA
self.QueueActivity( new CallFunc( () => ChooseNewProc(self, null)));
}
void ChooseNewProc(Actor self, Actor ignore)
public void ChooseNewProc(Actor self, Actor ignore)
{
LinkedProc = ClosestProc(self, ignore);
if (LinkedProc != null)