harv wont use enemy proc automatically anymore; ore goes to proc owner

This commit is contained in:
Chris Forbes
2009-11-17 22:06:03 +13:00
parent d05c9ca0de
commit 51b9e5c15f
2 changed files with 6 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ namespace OpenRa.Game.Traits.Activities
{
if( isDone )
{
self.traits.Get<Harvester>().Deliver( self );
self.traits.Get<Harvester>().Deliver( self, refinery );
return NextActivity ?? new Harvest();
}
else if( NextActivity != null )
@@ -42,7 +42,8 @@ namespace OpenRa.Game.Traits.Activities
umt = mobile.GetMovementType(),
checkForBlocked = false,
};
var refineries = Game.world.Actors.Where( x => x.unitInfo != null && x.unitInfo.Name == "proc" ).ToList();
var refineries = Game.world.Actors.Where( x => x.unitInfo != null
&& x.unitInfo.Name == "proc" && x.Owner == self.Owner ).ToList();
if( refinery != null )
search.AddInitialCell( refinery.Location + refineryDeliverOffset );
else

View File

@@ -19,10 +19,10 @@ namespace OpenRa.Game.Traits
else oreCarried++;
}
public void Deliver(Actor self)
public void Deliver(Actor self, Actor proc)
{
self.Owner.GiveCash(oreCarried * Rules.General.GoldValue);
self.Owner.GiveCash(gemsCarried * Rules.General.GemValue);
proc.Owner.GiveCash(oreCarried * Rules.General.GoldValue);
proc.Owner.GiveCash(gemsCarried * Rules.General.GemValue);
oreCarried = 0;
gemsCarried = 0;
}