harv wont use enemy proc automatically anymore; ore goes to proc owner
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user